Skip to main content

Layout

A 12-column grid, comfortable and compact density, page templates and content widths.

Density is a token mode, built like light and dark (DECISIONS.md #18). Set data-density="compact" on html or any region and control heights, the TopBar, gutters, margins, stack spacing and card padding tighten together. Type sizes and badge sizes do not change, and no control goes below the 24 px target size. Components read the tokens through utilities, so they adapt without props.

Side by side

The same Card, Input and Button composition in a comfortable scope and a compact scope.

data-density="comfortable"

Payout schedule

Next payout on 14 Oct 2026

Active
data-density="compact"

Payout schedule

Next payout on 14 Oct 2026

Active

What changes

From the token metadata: every layout and size token, its compact value, and the utility that reads it.

TokenComfortableCompactUtility
size.target.min

WCAG 2.2 SC 2.5.8 minimum target size

24pxsamemin-h-target-min
size.control.sm28px24pxh-control-sm
size.control.md32px28pxh-control-md
size.control.lg40px32pxh-control-lg
size.topbar

Height of the application TopBar. Sticky elements below it offset by this.

56px48pxh-topbar · top-topbar
size.sidenav

Width of the SideNav.

240pxsamew-sidenav
layout.gutter

Gap between grid columns.

24px16pxgap-gutter
layout.margin

Page padding at the edge of the main area.

32px24pxpx-margin
layout.section

Space between page sections.

32px24pxpy-section · gap-section
layout.stack-xs4pxsamegap-stack-xs
layout.stack-sm8pxsamegap-stack-sm
layout.stack-md16px12pxgap-stack-md
layout.stack-lg24px16pxgap-stack-lg
layout.inline-sm8pxsamegap-inline-sm
layout.inline-md12pxsamegap-inline-md
layout.card-x20px12pxpx-card-x (Card padding md)
layout.card-y16px12pxpy-card-y (Card padding md)
layout.card-x-sm16px8pxpx-card-x-sm (Card padding sm)
layout.card-y-sm12px8pxpy-card-y-sm (Card padding sm)
layout.grid.columns

Columns in the page grid. Divides into 2, 3, 4 and 6.

12samelayout-grid
layout.container.prose720pxsamemax-w-prose
layout.container.form640pxsamemax-w-form
layout.container.page1280pxsamemax-w-page
layout.container.wide1536pxsamemax-w-wide

When to use compact

  • Data-dense products used all day by specialists: ledgers, reconciliation, trading and operations consoles.
  • One dense region inside a comfortable page, such as a long transactions table.
  • Not for onboarding, settings or anything a person visits rarely; comfortable is the default.
  • Never as a fix for a layout that does not fit. Change the layout, not the density.

Recipe

<html lang="en" data-density="compact">        {/* the whole product */}
<section data-density="compact">…</section>       {/* one dense region, such as a ledger table */}
<section data-density="comfortable">…</section>   {/* opt back out inside a compact page */}