Space
The intentional use of empty area to communicate grouping, hierarchy and rhythm—helping users scan interfaces quickly and understand relationships without visual noise.
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 organizes information without visual noise
Permalink to "Space organizes information without visual noise"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.
Space uses a token-driven system
Permalink to "Space uses a token-driven system"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.
Space establishes hierarchy and grouping
Permalink to "Space establishes hierarchy and grouping"- 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
Space enables scanning and comprehension
Permalink to "Space enables scanning and comprehension"- 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
Why It Matters
Permalink to "Why It Matters"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.
Fixed vs fluid
Permalink to "Fixed vs fluid"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 |
Spacing sizes
Permalink to "Spacing sizes"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
Permalink to "Spacing classes"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 sidesinner-wide: Less padding on top and bottombottom: Adds margin on bottomleft: Adds left margin for inline elementsright: Adds right margin for inline elements
Size
3xsthrough4xl: see spacing sizes
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
Permalink to "Spacing tokens"Spacing tokens are used in styles for padding and margins of screen components and layouts.
| Token | Details | |
|---|---|---|
3xs
3XS white space |
||
2xs
2XS white space |
||
xs
XS white space |
||
sm
SM white space |
||
md
MD white space |
||
lg
LG white space |
||
xl
XL white space |
||
2xl
2XL white space |
||
3xl
3XL white space |
||
4xl
4XL white space |
See also: Space tokens for complete token documentation.