01
Overview
One-dimensional layout primitive for arranging direct children with flexbox.
Usage
Props
Stack supports direction, gap, align, justify, wrap, as, class, and children.
Accessibility
Stack does not add roles, keyboard behavior, or ARIA state. Choose as only when the rendered element carries correct document semantics for the content.
Account settings Manage your profile and preferences.
02
When to use
Use when
- Arranging related controls, form rows, or panel sections along one axis.
- You need lightweight spacing and alignment without two-dimensional grid placement.
Avoid when
- You need explicit rows and columns — use grid.
03
Examples
Basic stack
Arrange related content along one axis.
04
Props
| Name | Type | Default | Description |
|---|---|---|---|
direction | 'row' | 'column' | 'row-reverse' | 'column-reverse' | 'column' | Flex direction. |
gap | text | Uniform flex gap. | |
align | 'start''center''end''stretch''baseline' | 'stretch' | Cross-axis alignment. |
justify | 'start''center''end''between''around''evenly' | 'start' | Main-axis distribution. |
wrap | boolean | false | Whether child items may wrap onto additional lines. |
as | NonVoidHTMLElementTagName | 'div' | Rendered HTML tag. |
children required | snippet | Stack contents. |