Skip to main content
Principles

Space is the foundation of visual organization in Bolt. Consistent spacing patterns help users understand what belongs together, what is subordinate and what deserves focus. By controlling distance, rhythm and density, spacing establishes relationships and guides attention—reducing cognitive load and creating calmer, more readable experiences.

Bolt's spacing system is token-driven, using consistent incremental values as the foundational unit. This ensures predictable gaps that respect density settings (Compact / Default / Sparse) without breaking hierarchy or readability.


Space exists to communicate meaning through distance and rhythm. The amount of space between elements signals importance. Proper use of space allows layouts to remain clear and legible—even as content density increases.

Space should never be accidental. Elements placed close together are perceived as related. Increasing space between elements weakens their perceived relationship. Space is the primary method for grouping related content—prefer spacing over lines, boxes or decorative dividers.


Bolt's spacing system ensures consistency and scalability through strict standards:

  • All spacing uses predefined tokens from the system spacing scale—no ad-hoc values
  • Spacing respects density settings without breaking hierarchy or readability
  • Vertical rhythm ensures consistent, predictable gaps between stacked elements and sections
  • Spacing patterns repeat across similar layouts to reinforce familiarity and scanning efficiency

See also: Layout & Grid principles for how spacing works within grid structures.


  • Elements with more surrounding space are perceived as more important
  • Denser clusters signal supporting or subordinate content
  • Critical or high-priority elements require additional space to attract focus
  • Group related elements closely and separate unrelated elements with larger spacing intervals

  • Apply consistent spacing patterns to create predictable scanning rhythm
  • Use vertical rhythm to control separation between stacked elements—spacing must scale fluidly with density while preserving relative hierarchy
  • Introduce variation thoughtfully to guide attention and create emphasis
  • Prefer rhythm and spacing over decorative dividers for content separation
  • Ensure spacing never compresses below minimum legibility or focus state requirements
  • Content-heavy sections are allowed, but an entire page should not feel crowded—white space gives the eye places to rest. (Note: this refers to content density, not Bolt's global density settings.)
  • While spacing tokens enforce consistency, visual balance may require minor optical adjustments—use visual judgment to correct imbalances caused by differing visual weight, but remain within the spacing system

Consistent spacing reduces visual noise, accelerates comprehension and improves usability.

Clear spatial relationships help users understand structure quickly, scan more efficiently and feel less overwhelmed—especially in dense interfaces such as dashboards, forms and content-heavy pages. By relying on spacing rather than decoration, interfaces feel cleaner, more intentional and more trustworthy.

Simple rule of thumb: If users must work to understand what belongs together, the spacing isn't doing its job.

Implementation

Spacing may be fixed or fluid, indicating whether it responds to global density configuration.

Fixed spacing Fluid spacing
Used by Sass version of spacing tokens Used by CSS version of spacing tokens
Used by horizontal spacing classes Used by all other spacing classes
Value is fixed to default, regardless of density mode Value depends on global density configuration

When applying space to a focusable element, choose a size that ensures enough room to display Bolt's focus ring (currently 4px minimum) at all applicable density modes.

Size name Compact Default Sparse
3xs 1px 2px 4px
2xs 2px 4px 8px
xs 4px 8px 12px
sm 8px 12px 16px
md 12px 16px 20px
lg 16px 20px 24px
xl 20px 24px 32px
2xl 24px 32px 40px
3xl 32px 40px 48px
4xl 40px 48px 64px

Spacing classes may be used in markup to add margin or padding to an individual element.

Spacing classes apply Bolt spacing tokens to margin or padding in the specified size and direction. The class names follow the pattern:

bolt-space-{type}-{size}

Type

  • inner : Equal padding on all sides
  • inner-wide : Less padding on top and bottom
  • bottom : Adds margin on bottom
  • left : Adds left margin for inline elements
  • right : Adds right margin for inline elements

Size

The majority of spacing classes apply fluid spacing.

<div class="bolt-space-inner-xl">
  Equal padding on all sides
</div>
<div class="bolt-space-inner-wide-xl">
  Less padding on top and bottom
</div>
<div class="bolt-space-bottom-xl">
  Margin on bottom
</div>

Apply left and right space to inline items like navigation links to control the spacing between them.

Horizontal classes apply fixed spacing.

<span>
  No margin
</span>
<span class="bolt-space-left-lg">
  Left margin
</span>
<span class="bolt-space-left-lg">
  Left margin
</span>
<span class="bolt-space-right-lg">
  Right margin
</span>
<span class="bolt-space-right-lg">
  Right margin
</span>
<span>
  No margin
</span>

Spacing tokens are used in styles for padding and margins of screen components and layouts.

Token Details
3xs

3XS white space

Since
Default
2px
Sass
$space-3xs
CSS
--bolt-space-3xs
2xs

2XS white space

Default
4px
Sass
$space-2xs
CSS
--bolt-space-2xs
xs

XS white space

Default
8px
Sass
$space-xs
CSS
--bolt-space-xs
sm

SM white space

Default
12px
Sass
$space-sm
CSS
--bolt-space-sm
md

MD white space

Default
16px
Sass
$space-md
CSS
--bolt-space-md
lg

LG white space

Default
20px
Sass
$space-lg
CSS
--bolt-space-lg
xl

XL white space

Default
24px
Sass
$space-xl
CSS
--bolt-space-xl
2xl

2XL white space

Default
32px
Sass
$space-2xl
CSS
--bolt-space-2xl
3xl

3XL white space

Default
40px
Sass
$space-3xl
CSS
--bolt-space-3xl
4xl

4XL white space

Default
48px
Sass
$space-4xl
CSS
--bolt-space-4xl

See also: Space tokens for complete token documentation.

Display settings

Note: not all settings persist across pages

Default Compact (-1) Sparse (+1) XL (default) 2XL 3XL Default Min Max Light (default) System Dark Branded (default) Unbranded