Grid
Use Grid to create flexible and responsive grid-based layouts
import {Grid} from '@primer/react-brand'
The Grid
component uses a 12-column layout system. Use span
to control the number of columns that should be displayed.
Use span
with an Object
of breakpoint-specific keys and number
values to enable responsive behavior.
Breakpoints use min-width
, where it will also apply your chosen span
value to all larger breakpoints.
Use start
to provide a positioning offset.
name | type | default | required | description |
---|---|---|---|---|
as | 'div' 'section' 'span' | 'div' | false | The HTML element used to render the grid. |
enableOverlay | boolean | false | false | Visual aid to help with alignment. |
className | string | false | Sets a custom class on the element. | |
children | Grid.Column | true | ||
id | string | false | Sets a custom id attribute. |
name | type | default | required | description |
---|---|---|---|---|
as | 'div' 'section' 'span' | 'div' | false | The HTML element used to render the column. |
span | 1 2 3 4 5 6 7 8 9 10 11 12 ResponsiveMap | 12 | false | The number of columns the element should span or a responsive map. |
start | 1 2 3 4 5 6 7 8 9 10 11 12 ResponsiveMap | false | The column index to start the element or a responsive map. | |
className | string | false | Sets a custom class on the element | |
children | ReactElement | false | ||
id | string | false | Sets a custom id |