A primitive useful for grid layouts. Grid is Box with display: grid and
comes with helpful style shorthand. It renders a div element.
display: gridGrid to control the span, and start
positions within the grid.Here's an example of using grid template columns with the grid component, and
applying a gap or space between the grid items.
In some layouts, you might need certain grid items to span specific amount of
columns instead of an even distribution. Pass the span prop to GridItem
component to manage this distribution.
Pass the start and end prop to GridItem component to make an element start
or end at the nth grid position.
In some layouts, you might need certain grid items to span specific amount of
columns instead of an even distribution. Pass the span prop to GridItem
component to manage this distribution.
Grid composes Box so you can pass all the Box prop, and these shorthand prop
to save you some time:
| Verbose Prop | Shorthand Prop |
|---|---|
gridArea | area |
gridTemplateAreas | templateAreas |
gridGap | gap |
gridRowGap | rowGap |
gridColumnGap | columnGap |
gridAutoColumns | autoColumns |
gridColumn | column |
gridRow | row |
gridAutoFlow | autoFlow |
gridAutoRows | autoRows |
gridTemplateRows | templateRows |
gridTemplateColumns | templateColumns |
| Verbose Prop | Shorthand Prop |
|---|---|
gridColumnSpan | colSpan |
gridRowSpan | rowSpan |
gridColumnStart | colStart |
gridColumnEnd | colEnd |
gridRowStart | rowStart |
gridRowEnd | rowEnd |