Components
Stack
One-dimensional flex layout with token-based gaps.
Stack arranges items in a row or column and applies a spacing token as the gap. It is the default
one-dimensional layout primitive for vertical rhythm and simple horizontal groups. Use
Grid when items need two-dimensional placement.
Live preview#
Release checklistTokens are generated from the source stylesheet.Docs and components share the same visual language.
import { Stack, Text } from '@orkest/ui';
export function Example() {
return (
<Stack gap={3}>
<Text weight="semibold">Release checklist</Text>
<Text size="sm" tone="muted">
Tokens are generated from the source stylesheet.
</Text>
<Text size="sm" tone="muted">
Docs and components share the same visual language.
</Text>
</Stack>
);
}StatusReady
<Stack direction="row" align="center" gap={2}>
<Text weight="semibold">Status</Text>
<Text size="sm" tone="success">
Ready
</Text>
</Stack>Props#
| Prop | Type | Default |
|---|---|---|
direction | 'row' | 'column' | 'column' |
| Main axis of the flex container. | ||
gap | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 2 |
| Spacing step mapped to a --ok-space token. | ||
align | 'start' | 'center' | 'end' | 'stretch' | 'baseline' | 'stretch' |
| Cross-axis alignment. | ||
justify | 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly' | 'start' |
| Main-axis distribution. | ||
wrap | boolean | false |
| Allows items to wrap onto multiple lines. | ||
as | ElementType | 'div' |
| Element to render, preserving native attributes. | ||
Accessibility#
Stack does not add ARIA roles or keyboard behavior. It only changes visual layout.
- Reading order remains DOM order. Avoid visual reordering that contradicts the source order.
- Use
asto render semantic elements such asul,nav, orsectionwhen appropriate. - Direction and alignment are visual concerns; they should not change the meaning of the content.