layout primitive
<tc-stack>
Vertical layout primitive. Children flow top-to-bottom with consistent spacing.
import
"@ra9/tan-compose-kit/stack"
Props
| Name | Type | Default | Description |
|---|---|---|---|
gap | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | CSS length | "4" | Spacing between children. Numeric tokens map to `--tc-space-N` (1=4px, 2=8px, 3=12px, 4=16px, 5=24px, 6=32px, 7=48px, 8=64px). Any raw CSS length also works. |
align | "stretch" | "start" | "center" | "end" | "stretch" | Cross-axis alignment. Maps to `align-items` on the underlying flexbox. |
Slots
| Slot | Description |
|---|---|
(default) | Children — any markup; the stack just spaces them out. |
Examples
Basic usage
Gap scale
Numeric gap values map to the design system's spacing scale.
| Token | Pixels |
|---|---|
1 |
4px |
2 |
8px |
3 |
12px |
4 |
16px (default) |
5 |
24px |
6 |
32px |
7 |
48px |
8 |
64px |
You can also pass a raw CSS length:
Alignment
align controls how children are sized across the stack's width.
Form layout
The stack is the workhorse for stacking labelled form fields:
Theming
No theme variables — tc-stack is a layout primitive. Override the gap and align props directly.
Accessibility
- The stack renders a plain
<div>withflex-direction: column— no semantic role. It's transparent to assistive tech, which is correct: spacing isn't content. - Children keep their own semantics; the stack doesn't intercept focus or anything else.