Overview
Reference usage
One-dimensional layout primitive for arranging direct children with flexbox.
Usage
Props
Stack supports direction, gap, rhythm, align, justify, wrap, as, class, and children.
Use rhythm="page" for a column of page blocks. The stack puts --cinder-space-6 before each block after the first. A Section or a wrapper with a Section as its first child takes its step from the stack at --cinder-space-8. Dialogs, popovers, and drawers are excluded from this spacing. Choose either rhythm or gap.
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.
The default direction is column and wrap is false. Stack only owns layout: use gap, align, and justify for flex placement, and choose as="ul", as="nav", or another element only when the children satisfy that element's semantics. It does not make interactive children accessible or recover from overflow; choose a responsive layout or an explicit scroll container when content can exceed the available width.
When to use
- Arranging related controls, form rows, or panel sections along one axis.
- You need lightweight spacing and alignment without two-dimensional grid placement.
- Use rhythm="page" to lay out page blocks so a Section takes its step from the Stack.
- You need explicit rows and columns — use grid.
Examples
Basic stack
Arrange related content along one axis.
Props
Name | Type | Default | Description |
|---|---|---|---|
direction | 'row' | 'column' | 'row-reverse' | 'column-reverse' | 'column' | Flex direction. |
gap | text | Uniform flex gap. | |
rhythm | 'page' | Page spacing uses a block step with a larger step before a Section. | |
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. |