Skip to main content

Spacing

A 4 px scale and named layout distances that follow the density mode.

Which token for which distance

DistanceUtilityComfortable / compact
Label to its field, title to descriptiongap-stack-xs, gap-14 px
Inside a group of related linesgap-stack-sm8 px
Between form fieldsgap-stack-md16 / 12 px
Between groups inside a sectiongap-stack-lg24 / 16 px
Between buttons and inline controlsgap-inline-sm8 px
Between grid columnsgap-gutter24 / 16 px
Page edgepx-margin32 / 24 px
Between page sectionspy-section, gap-section32 / 24 px
Inside a cardCard padding (p-card-x/y)20×16 / 12×12 px

Rules

  • Arbitrary values (p-[13px]) fail lint. If the scale does not have the distance, the distance is wrong.
  • Components own their internal spacing. Use Card sections and its padding prop, not custom padding inside a card.
  • Use the semantic utility when one exists, so the layout follows the density mode. Raw steps (gap-4) stay the same in compact.
  • Layouts are designed for 1024 px and above (DECISIONS.md #3).