2.8.2 ā€¢ Published 3 years ago

@guardian/src-grid v2.8.2

Weekly downloads
719
License
Apache-2.0
Repository
github
Last release
3 years ago

Grid

šŸ“£ For more context and visual guides relating grid usage on the Source Design System website

Install

$ yarn add @guardian/src-grid

Use

import { GridRow, GridItem } from "@guardian/src-grid"

const Article = () => (
    <GridRow breakpoints={["mobile", "tablet", "desktop", "leftCol", "wide"]}>
        <GridItem span={[0, 3, 3, 4, 4]} borderRight={true}>
            <Sidebar />
        </GridItem>
        <GridItem span={[4, 9, 9, 10, 12]}>
            <Main />
        </GridItem>
    </GridRow>
)

GridRow Props

breakpoints

Array<GridBreakpoint | CustomBreakpoint> = "mobile", "tablet", "desktop", "leftCol", "wide"

A list of breakpoints at which grid column span may change. GridRow currently supports changes at "mobile", "tablet", "desktop", "leftCol" and "wide" breakpoints. Any of these may be omitted.

For best results, breakpoints should be ordered ascending by minimum viewport width.

A custom breakpoint may be specified, which must have the following properties:

  • width: the minimum viewport width at which the breakpoint becomes active. This will also be the width of the GridRow container
  • columns: the number of columns the grid should comprise

GridItem Props

span

number[]

The number of columns a grid item should span. Corresponds to the breakpoints list in GridRow props.

When a col span of 0 is specified for a particular breakpoint, the grid item will have display: none applied to it.

borderRight

boolean= false

Whether a border should appear to the right of the grid item.

2.8.2

3 years ago

2.8.1

3 years ago

2.8.0

3 years ago

2.8.0-rc.0

3 years ago

2.7.1

3 years ago

2.7.0-rc.0

3 years ago

2.7.0

3 years ago

2.6.0

3 years ago

2.6.0-rc.0

4 years ago

2.5.0

4 years ago

2.5.0-rc.1

4 years ago

2.5.0-rc.0

4 years ago

2.4.0

4 years ago

2.4.0-rc.0

4 years ago

2.3.0-rc.1

4 years ago

2.3.0

4 years ago

2.3.0-rc.0

4 years ago

2.2.0

4 years ago

2.2.0-rc.0

4 years ago

2.1.0-rc.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.9.1

4 years ago

2.0.0-rc.0

4 years ago

1.9.0-rc.1

4 years ago

1.9.0-rc.0

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.8.0-rc.0

4 years ago

1.7.0

4 years ago

1.7.0-rc.0

4 years ago

1.6.0

4 years ago

1.6.0-rc.0

4 years ago

1.5.0

4 years ago

1.5.0-rc.0

4 years ago

1.4.0

4 years ago

1.4.0-rc.1

4 years ago

1.4.0-rc.0

4 years ago

1.3.0

4 years ago

1.3.0-rc.0

4 years ago

1.2.0

4 years ago

1.2.0-rc.1

4 years ago

1.2.0-rc.0

4 years ago

1.1.0

4 years ago

1.1.0-rc.6

4 years ago

1.1.0-rc.5

4 years ago

1.1.0-rc.4

4 years ago

1.1.0-rc.3

4 years ago

1.1.0-rc.2

4 years ago

1.1.0-rc.1

4 years ago

1.1.0-rc.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.0-rc.0

4 years ago

0.18.1

4 years ago

0.18.0

4 years ago

0.18.0-rc.1

4 years ago

0.18.0-rc.0

4 years ago

0.17.0-rc.0

4 years ago

0.17.0

4 years ago

0.16.1

4 years ago

0.16.0

4 years ago

0.15.0

4 years ago

0.14.1

4 years ago

0.14.0

4 years ago

0.13.0

4 years ago

0.3.0

4 years ago

0.3.0-alpha.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.1.0-alpha.1

4 years ago

0.0.1

4 years ago