Skip to content

Grid

Compose columns and rows, asymmetrical fields, and nested cards that share tracks.

alpina-ui/ui/grid

Interactive preview

Morning session

Reading a poster

09.30–10.15

Afternoon session

From letterpress to the concert programme

14.00–15.30

Usage notes

Use width="site" for a centered 100rem frame. Column spans follow the container width. Use fields with rows to compose rectangular areas, or select thirds or five-seven for lead/detail pairs. Give each GridItem a field name and use subgrid="rows" to align content across cards. PageRegion provides a semantic landmark when the content already supplies its own grids. Use space="viewport" for a full-height poster. An id on a grid with guides gives the lines a matching id ending in -guides. The optional entrance="sequence" introduces an opening grid once and respects reduced motion. Use space="chapter" and surface to carry an editorial field across the viewport.

When to use

Give related blocks a shared edge, such as the name and contact details on an address card.

When to avoid

A single sequence of fields is easier to maintain in a Stack. Columns can make their reading order ambiguous.

Accessibility

Keep the DOM in reading order. Check that the title still precedes the details when the grid collapses to one column.

Keys
KeyAction
Tab / Shift+TabMove through any links or controls supplied inside the component, in document order.

Content

Use a short noun phrase at the head of each field. Allow adjacent columns to grow when the French phrase takes another line.

Use
Billing address / Route du Lac 8 / 1007 Lausanne
Avoid
Column 2 / Route du Lac 8 / More information

Copy in four languages

German
Rechnungsadresse16 characters
French
Adresse de facturation22 characters
Italian
Indirizzo di fatturazione25 characters
Romansh
Adressa da quint16 characters
Add to your project
npx --no-install alpina add grid