Skip to Content

Grid

A CSS Grid layout component for creating two-dimensional layouts with rows and columns. Ideal for building responsive page layouts, card grids, dashboards, and any design requiring precise control over both horizontal and vertical alignment.

Responsive columns

Use responsive objects to change the grid layout at different breakpoints.

Custom templates

For complex layouts, pass a custom CSS grid-template string.

Responsive custom templates

Custom CSS templates can also be responsive by passing an object with breakpoint keys.

Grid item placement

Component props

Grid extends Box and accepts all Box props.

NameTypeValues
displayResponsive<GridDisplay>"grid" | "inline-grid" | "none"
columnsResponsive<GridColumns | string>"1"-"12" | "none" | "subgrid" | custom CSS template
rowsResponsive<GridRows | string>"1"-"12" | "none" | "subgrid" | custom CSS template
autoFlowResponsive<GridAutoFlow>"row" | "column" | "dense" | "row-dense" | "column-dense"
justifyContentResponsive<JustifyContent>"center" | "start" | "end" | "space-between" | "space-around" | ...
justifyItemsResponsive<JustifyItems>"center" | "start" | "end" | "stretch" | "baseline" | ...
alignContentResponsive<AlignContent>"center" | "start" | "end" | "space-between" | "stretch" | ...
alignItemsResponsive<AlignItems>"center" | "start" | "end" | "stretch" | "baseline" | ...
gapResponsive<Gap>true | Spacing scale
gapXResponsive<Gap>true | Spacing scale
gapYResponsive<Gap>true | Spacing scale