Skip to content
Design System
Contact

Spacing & elevation

The 4px spacing grid, radius hierarchy, elevation levels and the density token.

Foundations4px grid--radius--row-h

Spacing scale

Tailwind's 4px grid. Six steps do nearly all the work in dense UI; they are highlighted. Pick a step to see it as padding and gap.

4px grid
Step 3
AcmeGlobexInitech

Padding …, gap …

12px

Card grids, panel padding on mobile

spacing.tsxtsx
1<div className="flex gap-3 p-3">
2 …
3</div>
4
5// 3 × 4px = 12px

Radius

Radius grows with the size of the thing, so nesting reads naturally: a 6px row inside an 11px panel inside a 14px sheet. Values are measured from the rendered examples.

Radius hierarchy
rounded-[5px]

Tags, badges, kbd

Design
…fixed 5px
rounded-md

List items, menu rows

Inbox
…--radius × 0.8
rounded-lg

Buttons, inputs, selects

SearchSave
…--radius
rounded-xl

Panels, cards, canvases

Open deals24
…--radius × 1.4
rounded-2xl

The workspace sheet, sheets

…--radius × 1.8
Try another --radius (this preview only)

Elevation

Three shadows, each with one job. Resting content is flat and bordered; shadow means floating or clickable.

shadow-lift

Hover state of clickable cards, paired with -translate-y-px. Never at rest.

shadow-float

Menus, popovers, the command palette: anything that floats above the page.

shadow-sheet

The workspace sheet on the canvas. One per screen.

Interactive card
hover:shadow-lift hover:-translate-y-px
Borders over shadows
Do

Revenue

Hairline border, flat

Don't

Revenue

Heavy shadow at rest

Resting surfaces separate with a 1px border. Shadows mean something moved: it floats, or you are about to click it.

globals.csscss
1--shadow-lift: 0 1px 2px rgb(16 18 27 / 0.05), 0 6px 16px -6px rgb(16 18 27 / 0.12);
2--shadow-float: 0 0 0 1px var(--sheet-edge), 0 12px 32px -8px rgb(16 18 27 / 0.18), 0 2px 6px rgb(16 18 27 / 0.06);
3--shadow-sheet: 0 0 0 1px var(--sheet-edge), 0 1px 2px rgb(16 18 27 / 0.04), 0 8px 24px -12px rgb(16 18 27 / 0.08);

Density

Table and list rows use h-(--row-h): 40px comfortable, 32px compact. Settings → Density sets data-density on the html element; the same attribute works on any wrapper, which is how this preview switches on its own.

--row-h
Demo data
AccountOwnerStageValue
Acme CorporationMCMaya Chen Proposal$24,000
NorthwindLPLeo Park Won$18,400
GlobexASAna Silva Negotiation$9,850
InitechSRSam Reyes Lost$4,200
Density (this preview only)

Row …, --row-h …

Breakpoints

Tailwind's defaults, mobile first. The row for your current window is marked and follows resizes.

PrefixMin widthWhat changes
(none)Mobile0Bottom nav, drawer sidebar; test at 390px
sm:Small640pxTwo-column grids, wider gutters
md:Medium768pxTables stop turning into cards
lg:Large1024pxShell switches to desktop: sidebar and sheet
xl:Extra large1280pxContext panel appears on the right