Skip to main content

Spacing

How space shows what belongs together.

space.gap.tight space.gap.default space.gap.group space.gap.section space.inset.control-x space.inset.container space.inset.cell-x size.row

The five answers​

QuestionAnswerWhy
Which spacing roles does it need?Gaps, insets and row heightsLarge rows matter for touch and zoom.
How many densities exist?OneOne density; no compact mode to fail people.
How are spacing steps defined?Big, even stepsBig, even steps lower effort.
How dense is the layout?SpaciousSpace lowers effort and mis-taps.
Where does spacing matter most?Between fieldsSpace between fields prevents mis-taps.

Tokens​

Each token points to another token. Values live only on primitives, below.

TokenPoints to
space.gap.tightspace.12
space.gap.defaultspace.16
space.gap.groupspace.32
space.gap.sectionspace.48
space.inset.control-xspace.24
space.inset.containerspace.24
space.inset.cell-xspace.16
size.rowsize.56

The raw values these tokens end at are on Primitives › Space and size.

The component spacing map​

Inside a component, spacing is a step of this map. Each step is 4px × its multiplier × the scheme's rhythm, rounded to a multiple of 4px, at most 64px. In Accessible first the rhythm is 1.75. Spacious: space lowers effort and mis-taps, so components get the most room short of the brand scheme; rows stay tight.

Steps that hold still stay at 4px × their multiplier in every scheme. The hairline is a fixed 2px nudge. In code, write the step's utility: p-map-x6, gap-map-x2.

StepMultiplierUtilityToken and value
hairline (holds still)fixed*-map-hairlinecomponent-spacing-map.hairline space.2:2px
x1 (holds still)×1*-map-x1component-spacing-map.x1 space.4:4px
x2 (holds still)×2*-map-x2component-spacing-map.x2 space.8:8px
x3×3*-map-x3component-spacing-map.x3 space.20:20px
x4×4*-map-x4component-spacing-map.x4 space.28:28px
x6×6*-map-x6component-spacing-map.x6 space.44:44px
x8×8*-map-x8component-spacing-map.x8 space.56:56px
x12×12*-map-x12component-spacing-map.x12 space.64:64px

Between things and on the page, use a role instead: *-tight (12px), *-default (16px), *-group (32px), *-section (48px), *-control (24px), *-container (24px), *-cell (16px). A spacing is never a number.

When to use what​

SituationUseNotWhy
Items that belong togetherspace.gap.defaultspace.gap.tightGenerous space lowers mis-taps.
Between page sectionsspace.gap.sectionA thin lineSpace is easy to see; thin lines are not.
Table row heightsize.row (large)A compact rowLarge rows are easy to read and tap.