Design System

Space reference ​

Every rung and fixed value, with what it is for. For what these mean, see Overview. For how to choose between them, see Usage.

Values are in pixels and do not change when a user changes their interface text size.

The rungs ​

RungClassPixelsSizeUsed for
0gap-00px Removing space
1gap-14px An icon against its label, a badge against its text
2gap-28px Items in a row, the inner padding of a control
3gap-312px Menu rows, list rows, toolbars
4gap-416px Groups inside a panel, the padding of a card or dialog
6gap-624px Separate sections
8gap-832px Sections within a page
12gap-1248px Page level, empty states, around an illustration

There is no 5, 7, 9, 10 or 11. A margin or an offset takes a leading minus at any rung, where an element has to pull back onto a neighbour.

Control padding ​

The half steps either side of rung 1, and rung 1 itself. Two of the three sit off the 4 pixel grid.

ClassValue
p-0.52px
p-14px
p-1.56px

The axis spellings take the same three values, so py-1.5 and px-1.5 are each the same 6 pixels.

Radius ​

ClassValueFor
rounded6pxEvery rectangular surface
rounded-fullA round shapeDots, avatars and pills
rounded-none0Removing the corner

Dialog widths ​

ClassValueFor
max-w-dialog-sm400pxA confirmation or a single field
max-w-dialog-md600pxA form with a short body
max-w-dialog-lg800pxThe widest forms

Derived by shrinking each dialog in Caido until its content overflowed, at 188px for a confirmation and 439px for a short form.

Border widths ​

border, border-2 and border-4 emit 1, 2 and 4 pixels. They come from the framework as fixed values, so there is nothing to tokenise.

The layout components ​

ComponentWhat it does
StackPuts a gap between children in either direction
HStackA horizontal stack
VStackA vertical stack
StackItemSays whether one child grows or shrinks
PropOnAccepts
gapall stacks0 1 2 3 4 6 8 12. Defaults to 2
padding, paddingBlock, paddingInlineall stacks0 1 2 3 4 6 8 12
directionStackhorizontal, vertical. Defaults to vertical
alignStackstart, center, end, stretch, baseline. Defaults to stretch
justifyStackstart, center, end, between. Defaults to start
alignX, alignYHStack, VStackstart, center, end, plus between along the direction and stretch or baseline across it. HStack defaults to start and center, VStack to stretch and start
wrapall stacksboolean. Defaults to false
grow, shrinkStackItemboolean. grow defaults to false, shrink to true

HStack and VStack name the axes rather than taking the align and justify that Stack does, because on a horizontal stack align is vertical and on a vertical stack it is horizontal, and neither name says which.

What not to write ​

Never writeExamplesWrite instead
Preset cornersrounded-xs, rounded-sm, rounded-md, rounded-lgrounded. Each already resolves to the same 6 pixels
Shadowsshadow-sm, shadow-md, shadow-lgnothing. Layering is z-index, see Depth

A preset corner is aliased onto the one radius so the component library keeps working, and a lint rule reports it in first party markup, at error. A shadow other than shadow-none is the silent case: it generates no CSS and reports nothing.