Grid
Two-dimensional layout.
A CSS grid with token-based gaps. Prefer `minItemWidth` over a fixed column count: it produces a track list that reflows on its own, with no media queries to maintain.
Import
import { Grid } from "@abbainitiative/ui";Also available from the subpath entry @abbainitiative/ui/grid.
This component has no state and no event handlers, so it renders inside a Server Component without a client boundary of your own.
Examples
Self-reflowing grid
Resize the preview — no breakpoints are involved.
One
Two
Three
<Grid minItemWidth="12rem" gap={4}>
<Card><CardBody>One</CardBody></Card>
<Card><CardBody>Two</CardBody></Card>
<Card><CardBody>Three</CardBody></Card>
</Grid>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| columns | number | Fixed number of equal columns. Ignored when minItemWidth is set. | |
| gap | SpaceToken | Space between grid items. | |
| minItemWidth | string | Minimum width per item, e.g. "16rem". Produces a self-reflowing grid. |
Accessibility
- Grid does not change reading order; DOM order is what screen readers and keyboard users follow.