Layout

Four single-purpose layout primitives covering the spacing patterns we use most: Stack for vertical, Cluster for horizontal-with-wrap, Grid for auto-fit columns, Masonry for packed columns of variable-height items. Each accepts a --gap CSS variable so the same class works for tight toolbars and breathing-room hero sections. Grid and Masonry also accept --min to set the minimum column width.

Why these: avoids inline style="display: flex; gap: …; flex-direction: column" in markup. They compose freely — a Stack of Clusters is a common form-row pattern.


Stack — vertical with gap

Default gap is --lb-size-4x (16px). Override via inline style="--gap: …". Common gap tokens: 1x (4px) for tight, 2x (8px) for compact, 4x (16px) default, 6x (24px) for breathing room.

Default gap (16px)
First
Second
Third
Tight gap (4px) — style="--gap: var(--lb-size-1x)"
First
Second
Third
Generous gap (32px) — style="--gap: var(--lb-size-8x)"
First
Second
Third

Cluster — horizontal with gap, wraps

Use for button rows, tag groups, breadcrumb-like sequences. Wraps when content exceeds available width. Default gap --lb-size-3x (12px) — tighter than Stack since horizontal spacing reads bigger.

Buttons — common toolbar pattern
End-aligned — .lb-cluster--end
Between — title + actions split — .lb-cluster--between

Settings

Wrapping — many tags, narrow container
Design Engineering Product Marketing Operations Sales

Grid — auto-fit columns

Self-responsive grid. Specify the minimum column width via --min; the layout fits as many columns as fit and wraps the rest. The min(var(--min), 100%) trick prevents overflow on viewports narrower than --min.

Default — 16rem min, 16px gap
Col 1
Col 2
Col 3
Col 4
Narrower — style="--min: 8rem"
A
B
C
D
E
F
G
H
Wider columns — style="--min: 24rem; --gap: var(--lb-size-6x)"
Wide column 1
Wide column 2
Wide column 3

Composition — the form-row pattern

Stack of Clusters: each cluster is a horizontal row with a label and an input; the stack manages vertical rhythm. Same pattern handles settings panels, multi-field forms, dashboard sections.

Composition — Card grid

Grid of Cards is the most common dashboard pattern. --min drives the card size; the grid handles wrapping for free.

First card

Lorem ipsum dolor sit.

Second card

Consectetur adipiscing elit.

Third card

Sed do eiusmod tempor.

Masonry — packed columns, variable heights

Pinterest-style packed layout. Items with different heights flow into the shortest column instead of aligning to row baselines — useful for photo grids, card walls with mixed-length excerpts, mood boards. Same --min and --gap custom-property API as .lb-grid; built on CSS multi-column for universal browser support.

Reading-order caveat: items flow column-by-column (A → D → G top-to-bottom in column 1, then B → E → H in column 2). Use only for visual content where strict left-to-right reading isn't required. For ordered/scannable lists, use .lb-grid.

Card wall — variable card heights

A — short

One line.

B — medium

Two lines of supporting text that wrap to roughly fill the card body region.

C — tallest

Significantly more content here so this card grows much taller than its neighbours. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

D — short

Brief.

E — medium-long

Slightly longer to vary the visual rhythm. Multiple sentences. Mostly filler.

F — short

One line again.

G — medium

Two-line body. Notice how items pack tightly without row alignment.

H — tall

Another deeper card to keep the column heights uneven. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod.

Tighter columns — style="--min: 10rem"

Compact A

Short.

Compact B

Medium-length text spanning a couple of lines.

Compact C

Tall — more content makes this card stretch significantly. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Compact D

Mid.

Compact E

Short again.

Compact F

Two lines.