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 heightsRow height is a decision of its own in a table product.
How many densities exist?TwoA second, denser size serves tables and toolbars.
How are spacing steps defined?Small steps, on a 4px gridSteps on a 4px grid give the small gaps dense screens need.
How dense is the layout?CompactCompact spacing shows more records.
Where does spacing matter most?Rows and cellsSpace is spent inside rows and cells.

Tokens​

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

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

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 Dense data the rhythm is 1. Compact: more records fit on one screen, so components keep their tightest spacing.

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.12:12px
x4×4*-map-x4component-spacing-map.x4 space.16:16px
x6×6*-map-x6component-spacing-map.x6 space.24:24px
x8×8*-map-x8component-spacing-map.x8 space.32:32px
x12×12*-map-x12component-spacing-map.x12 space.48:48px

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

When to use what​

SituationUseNotWhy
Items that belong togetherspace.gap.tightspace.gap.groupThings that belong together sit close.
Between page sectionsspace.gap.section and a hairlineA card around every sectionLines separate without taking room from the data.
Table row heightsize.row (compact)The comfortable rowCompact rows show more records without scrolling.