Grid
Two-dimensional layout with visible guides. Wrap every Grid in GridSystem.
Empty grid
columns and rows are numbers. height preserve-aspect-ratio keeps the cell math square.
Cells
GridCell auto-flows when column and row are omitted.
Solid cells
solid paints a background so guides do not show through a tile. column and row accept CSS grid lines such as 1/3.
Responsive
columns, rows, and cell spans can be { sm, md, lg }. Breakpoints are 600px and 960px. unstable_use-container measures the wrapper, not the viewport.
1
<GridSystem unstable_use-container>
2
<Grid
3
:columns="{ sm: 1, md: 2, lg: 3 }"
4
:rows="{ sm: 6, md: 3, lg: 2 }"
5
>
6
<GridCell>1</GridCell>
7
<GridCell>2</GridCell>
8
<GridCell>3</GridCell>
9
<GridCell>4</GridCell>
10
<GridCell>5</GridCell>
11
<GridCell>6</GridCell>
12
</Grid>
13
</GridSystem>
Responsive spans
A solid cell can change its line range per breakpoint.
Hidden guides
hide-guides is row or column — not both. Hiding both means a plain Tailwind grid is enough.
Overlapping cells
Explicit line ranges can stack. Later cells paint above earlier ones.
Crosses
GridCross marks an intersection. column and row are 1-based guide indices, including the trailing edge.
Dashed guides
1
<GridSystem dashed-guides :guide-width="1" unstable_use-container>
2
<Grid :columns="1" :rows="1">
3
<GridCross :column="1" :row="1" />
4
<GridCross :column="2" :row="1" />
5
<GridCross :column="2" :row="2" />
6
<GridCross :column="1" :row="2" />
7
<GridCell>Content here</GridCell>
8
</Grid>
9
</GridSystem>
Debug
debug outlines the system and every cell so span math is visible while you author.
Best practices
- Use Grid when the guides are part of the design — marketing bands, docs landings, feature tiles. Plain cards and lists should stay on Tailwind
grid. - Always wrap in
GridSystem. Docs and embeds should setunstable_use-containersosm/md/lgfollow the wrapper width. - Set columns and rows at all three breakpoints when the layout reflows. One number is fine for a fixed frame.
solidon a cell that needs an opaque tile. Without it, guides draw through the content.- Do not nest Grid more than one level. Guide overlap turns into noise and the cell math breaks.
GridPageis a full-viewport shell (min-h-dvh). Keep it off this docs canvas; use it as a page root.- Guides are decorative. Put semantics on the cell content. If a cell is tappable, give it its own focus ring.