Usage
import { Grid, GridItem } from "@chakra-ui/react"<Grid>
<GridItem />
<GridItem />
</Grid>Examples
Col Span
Pass colSpan prop to GridItem to span across columns.
Spanning Columns
In some layouts, you may need certain grid items to span specific amount of columns or rows instead of an even distribution
rowSpan=2
colSpan=2
colSpan=2
colSpan=4
Props
| Prop | Default | Type |
|---|---|---|
templateColumns | SystemStyleObject['gridTemplateColumns'] | undefined | |
autoFlow | SystemStyleObject['gridAutoFlow'] | undefined | |
autoRows | SystemStyleObject['gridAutoRows'] | undefined | |
autoColumns | SystemStyleObject['gridAutoColumns'] | undefined | |
templateRows | SystemStyleObject['gridTemplateRows'] | undefined | |
templateAreas | SystemStyleObject['gridTemplateAreas'] | undefined | |
column | SystemStyleObject['gridColumn'] | undefined | |
row | SystemStyleObject['gridRow'] | undefined | |
inline | boolean | undefined | |
as | React.ElementTypeThe underlying element to render. | |
asChild | booleanUse the provided child element as the default rendered element, combining their props and behavior. For more details, read our Composition guide. |