Stack
stableArranges children in a row or column with consistent spacing.
Basic usage
OneTwo
Examples
Direction and spacing
Use column stacks for form groups and row stacks for action clusters.
DraftReviewReady
Owner
Design systems team
Action rows
Stack keeps repeated action rows predictable without introducing another layout component.
Alignment and dividers
Stack supports row/column directions, numeric spacing, wrapping and inserted dividers.
OneTwo
Features
- Row or column direction.
- Tokenized spacing.
Installation
bash
pnpm dlx structyl add stackAPI Reference
Stack
Flex stack layout.
| Prop | Type | Default |
|---|---|---|
| direction | 'row' | 'row-reverse' | 'column' | 'column-reverse'Flex direction. | 'column' |
| spacing | 'none' | 'xs' | 'sm' | 'md' | 'lg' | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8Gap between children. | 'md' |
| divider | React.ReactNodeInserted between children. | — |
| alignItems | 'start' | 'center' | 'end' | 'stretch' | 'baseline'Cross-axis alignment. | — |
| justifyContent | 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'Main-axis alignment. | — |
| flexWrap | 'nowrap' | 'wrap' | 'wrap-reverse'Flex wrapping behavior. | — |
| className | stringAdditional Tailwind classes merged with the component defaults. | — |