Skip to content

Stack

Stack arranges children vertically with consistent spacing. Use .stack on a wrapper. Add a gap modifier (e.g. .gap-2, .gap-4) to control the space between items.

Basic usage

html
<div class="stack">
  <p>First item</p>
  <p>Second item</p>
  <p>Third item</p>
</div>

Default gap uses Sprout’s spacing scale. Override with a modifier:

ClassSpacing
.stack.gap-1Tight
.stack.gap-2Small
.stack.gap-3
.stack.gap-4Default
.stack.gap-5
.stack.gap-6Large
.stack.gap-8Extra large
html
<div class="stack gap-4">
  <button>First</button>
  <button class="outline">Second</button>
  <button class="ghost">Third</button>
</div>

Usage notes

  • Stack is flexbox with flex-direction: column. Use it for forms, card content, or any vertical list of blocks.
  • Prefer gap modifiers over custom margins so spacing stays consistent with the design tokens.
  • Combine with .container or inside a .card for page or card structure.

MIT License · Lightweight by principle. Sustainable by design.