Skip to the page
Supply UI

Stack

Things under each other, spaced by gap rather than by margins on the children

Preview

Morning09:30 Noor HaddadCut and finish · 45 min11:00 Otis BrandtColour · 2 hours
Afternoon14:15 Yuki TanabeBeard trim · 20 min

Use

The code of the preview above
import { ItemText, Stack } from '@/components/ui';

<Stack gap={6}>
  <Stack gap={2}>
    <span className="ui-overline">Morning</span>
    <ItemText title="09:30 Noor Haddad" note="Cut and finish · 45 min" />
    <ItemText title="11:00 Otis Brandt" note="Colour · 2 hours" />
  </Stack>
  <Stack gap={2}>
    <span className="ui-overline">Afternoon</span>
    <ItemText title="14:15 Yuki Tanabe" note="Beard trim · 20 min" />
  </Stack>
</Stack>

This page as text, for an AI

Options

OptionTypeWhat it does
gap 1 | 2 | 3 | 4 | 6 | 8 | 12The space between them: 1–4 inside a group, 6 between groups, 8 between the parts of a screen, 12 between the sections of a public page.

It also takes the 280 attributes of the element or UI SDK part it draws: className, aria-label, events and the rest.

Without React

The same look on any HTML, with the classes ui-stack + ui-gap-4.

In the examples

Small screens made with it and the rest of the kit. They work: click, type and choose in them.

Sales€4,12012% on October
Orders968 more
Returns32 fewer
The month in three numbers A figure, its change, and the line that led there
0 – 10
Kraft boxes, small
Thank-you cards
Packing tape
Running low Set a range and the shelf list narrows to it

Classes this week

  • Wheel throwingTue 18:002 spots
  • GlazingThu 18:305 spots
  • Hand buildingSat 10:00Full
Loading, politely Grey shapes hold the place until the classes arrive
  1. Plan
  2. You
  3. Confirm
  4. Done
Join in three steps A plan, a name, a tick. Next stays off until each step is done.

Layout: states, do and don’t

Things under each other. The gap says how far apart they belong: 1–4 inside a group, 6 between groups, 8 between the parts of an app's screen, 12 between the sections of a public page (a landing page's rooms, reviews and questions). A landing page made with 8 reads as one crowded block.

States. Layout follows the box it is in, not the window: Split, Grid, AppShell and the site parts stack when their box is narrow, at any width of the window.

Do

  • Space with gap (Stack, Row, Grid), never with margins on children.
  • Put the page's sections straight on the page, under their titles; a Card is one thing a person picks or acts on.
  • Check every screen at 320, 375 and 768 px with the narrow check of rule 10.

Don't

  • Don't give a box a fixed width, or a min-height together with an aspect-ratio.
  • Don't nest a card in a card.
  • Don't put two <main>s on a page: a screen shown inside another page takes Main as="div".