Skip to content

Grid

Cells laid out on a grid with visible guide lines between them.

Global edge

Pages load from the region nearest each visitor.

Preview branches

Every pull request gets its own address.

Speed insights

See how real visitors experience each page.

Automatic HTTPS

Certificates are issued and renewed for you.

Instant rollbacks

Put any earlier deploy back in one click.

Command line

Deploy, inspect and tail logs from a terminal.

Installation

  1. Add the registryOnce per project
  2. Add grid

Usage

Grid renders its guides, the lines between cells, from its columns and rows, so set both. Each GridCell fills the next free cell in order, unless its column and row place it.

Use Grid where the lines are part of the design, as in a feature list or the sections of a landing page. For cards or a list in a few responsive columns, use Tailwind's grid and grid-cols-* utilities directly. Grid is only worth using when its guides show.

Breakpoints

columns, rows and a cell's column, row and solid each take an object of values by breakpoint, such as { base: 1, md: 3 }. A breakpoint takes the value of the one before it unless it has its own. The breakpoints are Tailwind's container sizes, measured on the grid itself rather than the viewport, so a Grid lays out the same in a narrow sidebar on a wide screen as on a phone.

Composition

Examples

Basic

Cells without a column or row fill the grid in order.

1
2
3
4
5
6

Solid cells

solid gives a cell the background behind the grid. The guides inside the cell disappear, and the lines along its edges stay. Without it, the guides show through a cell that spans several columns, as they do through 5 + 6.

1 + 2
3
4
5 + 6

Responsive

Resize the page to see the grid go from one column to two to three.

1
2
3
4
5
6

Responsive solid cells

A cell can span, move and become solid at different breakpoints. In this example, 1 + 2 is solid only from sm, where it spans both columns.

1 + 2
3
4
5 + 6

Row guides only

guides="rows" renders only the lines between rows, for a list of rows. guides="columns" renders only the lines between columns. Hide one set only when the layout reads along one axis and the lines across it would add nothing. If you'd hide both sets, use Tailwind's grid utilities instead.

v4.2.0
Nov 3
Faster cold starts in every region.
v4.1.0
Oct 14
Preview branches get their own logs.
v4.0.0
Sep 22
A new dashboard and command line.

Column guides only

Requests1.2M
Cache hit rate94%
Median response38 ms

Placement

column and row place a cell, as a number or as a grid-column or grid-row value such as "2 / 4" or "span 2". Cells without them fill in around the placed ones. Placed cells can overlap: later cells sit on top, and a solid cell hides what's beneath it.

1
2
Spans columns 2 and 3 and both rows.
3
4

Square cells

square sizes the rows to match the columns, so every cell is square, even with nothing in it.

Stacked

Grids placed one after another share the border between them, so sections of a page can each have their own columns.

Ship from your branch

Every push builds and gets its own address.

01Build
02Preview
03Promote

Props

Base UI's styling (opens in a new tab) and composition (opens in a new tab) guides say more about className, style and render.

Grid

GridCell