Stack
A vertical flex layout that stacks children with consistent spacing. Use it instead of writing flex flex-col gap-* manually.
Basic Usage
Gap Sizes
The gap prop controls the spacing between children. All values use design tokens.
Alignment
Control the cross-axis alignment of children with the align prop.
Justification
Control the main-axis distribution with the justify prop.
Semantic Elements
Use the as prop to render a semantic HTML element.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
gap |
string | 'md' |
Spacing: none, xs, sm, md, lg, xl, 2xl |
align |
string | 'stretch' |
Cross-axis: start, center, end, stretch, baseline |
justify |
string | 'start' |
Main-axis: start, center, end, between, around, evenly |
wrap |
bool | false |
Allow wrapping |
as |
string | 'div' |
HTML element to render |
scope |
string|null | null |
Scoped personalization name |
Keyboard Interaction
This component is a layout wrapper. Keyboard interaction is delegated to its children.
Design Tokens
| Token | Default | Description |
|---|---|---|
--space-wk-xs |
0.25rem |
Extra small gap |
--space-wk-sm |
0.5rem |
Small gap |
--space-wk-md |
1rem |
Medium gap |
--space-wk-lg |
1.5rem |
Large gap |
--space-wk-xl |
2.5rem |
Extra large gap |
--space-wk-2xl |
4rem |
Double extra large gap |
The rung names are shared with a second ladder, and the values are not. This prop reads --space-wk-*; the tighter --gap-wk-* ladder uses the same xs…2xl labels with different values from md up, and WireKit's own components read it for spacing inside a component. Swapping one for the other by name silently re-spaces the container — see Two spacing ladders, same rung names.