Skip to content

Grid

Deprecated

Grid is a component that exposes grid system props. See the CSS Tricks Complete Guide to Grid to learn more about Grid Layout.

Deprecation

Use Box instead.

Before

<Grid gridTemplateColumns="repeat(2, auto)" gridGap={3}>
<Box p={3} color="text.inverse" bg="bg.infoInverse">
1
</Box>
<Box p={3} color="text.inverse" bg="bg.warningInverse">
2
</Box>
</Grid>

After

<Box display="grid" gridTemplateColumns="repeat(2, auto)" gridGap={3}>
<Box p={3} color="text.inverse" bg="bg.infoInverse">
1
</Box>
<Box p={3} color="text.inverse" bg="bg.warningInverse">
2
</Box>
</Box>

Default example

1
2

System props

Grid components get GRID, COMMON, and LAYOUT system props.

Read our System Props doc page for a full list of available props.

Component props

Grid does not get any additional props other than the system props mentioned above.

Edit this page on GitHub
2 contributorsVanAndersonemplums
Last edited by VanAnderson on July 22, 2021