Skip to main content

Spacing System

UI Design

What is a Spacing System

A spacing system is a fixed set of spacing values that a product uses for margins, padding and gaps. Instead of picking any number, designers and developers choose from one shared scale.

How a Spacing System works

  • Base unit: Often 8 px, sometimes 4 px
  • Scale: Values built from the base, such as 4, 8, 16, 24, 32
  • Tokens: Each value has a name in code
  • Components: Padding inside components uses the same scale

Examples of Spacing Systems

Atlassian and GitLab Pajamas build their spacing on an 8 px base unit. IBM's Carbon uses multiples of 2, 4 and 8, with small steps for detailed components and larger steps for page density.

Benefits of a Spacing System

A shared scale keeps layouts consistent, speeds up design decisions and makes handoff exact, since a token name replaces a pixel guess. It also prepares a product for responsive layouts and different density settings.

Frequently asked questions

What is a spacing scale?

A spacing scale is a fixed set of spacing values built from a base unit, such as 4, 8, 16, 24 and 32. Designers and developers pick from the scale instead of using any number.

Which base unit should a spacing system use?

Many systems use 8 px, including Atlassian and GitLab Pajamas. IBM's Carbon combines multiples of 2, 4 and 8 so it has small steps for detailed components.

How is a spacing system used in code?

Each value becomes a design token, which developers apply to margin, padding and gaps. Changing a token updates the spacing everywhere it is used.