Skip to content
Fleetline

Stack

Usage

Stack spaces its children evenly along one axis; it is how Fleetline keeps components margin-free. A form is a vertical stack of fields; a header is a horizontal stack of title and actions. Use Cluster for items that should wrap onto new lines (button rows, filter chips, tags), and Grid for two dimensions.

Anatomy

  1. Container — .stack (column) or .stack--horizontal (row), or .cluster (wrapping row)
  2. Gap — .stack--gap-{1|2|3|4|6|8} or --stack-gap / --cluster-gap
  3. Children — any elements, no margins

Examples

Stack

WO-4182 · Replace front brake pads
WO-4185 · Annual safety inspection
WO-4190 · Replace wiper blades
gap-14px
gap-28px
gap-312px
gap-416px
gap-624px
gap-832px
<div class="stack stack--gap-3">…</div>
<div class="stack stack--horizontal stack--gap-2">…</div>

<!-- Any token works through the custom property -->
<div class="stack" style="--stack-gap: var(--space-5)">…</div>

Cluster

Open work orders (12)
<div class="cluster">…</div>
<div class="cluster cluster--between"><h2>Open work orders (12)</h2><button …>New work order</button></div>

API

HookValuesPurpose
.stackblock classVertical flex column with gap
.stack--horizontal, .stack--align-centermodifier classRow direction; center alignment
.stack--gap-1 | -2 | -3 | -4 | -6 | -8modifier classGap from --space-* (4 is default)
.cluster, .cluster--betweenblock / modifierWrapping row; push items to the ends
--stack-gap, --cluster-gapcustom propertyAssign a --space-* token

Do and don't

Do use Cluster for button rows so they wrap on narrow screens and long translations.
Don't put long or many items in a non-wrapping horizontal stack — it overflows at 320px.

Accessibility

Tokens

Custom propertyPurpose
--space-1 | -2 | -3 | -4 | -6 | -8Gap steps
--stack-gap (default --space-4), --cluster-gap (default --space-2)Component-level gap hooks