Stack
A flex layout container with configurable direction, spacing, and alignment. Includes HStack and VStack convenience variants.
LayoutNon-interactive
HStack (horizontal)
1
2
3
VStack (vertical)
Item A
Item B
stack.rs
use stratum_leptos::*;
view! {
<HStack spacing=StackSpacing::Md>
<Button>"One"</Button>
<Button>"Two"</Button>
<Button>"Three"</Button>
</HStack>
<VStack spacing=StackSpacing::Sm>
<Input placeholder="Name" />
<Input placeholder="Email" />
</VStack>
}Installation
stratum add stackProps
| Prop | Type | Default | Description |
|---|---|---|---|
| direction | StackDirection | Column | Flex direction: Row, Column, RowReverse, ColumnReverse |
| spacing | StackSpacing | Md | Gap size: None, Xs, Sm, Md, Lg, Xl |
| align | StackAlign | Stretch | Align items: Start, Center, End, Stretch, Baseline |
| justify | StackJustify | Start | Justify content: Start, Center, End, Between, Around, Evenly |
Variants
HStack— shorthand forStackwithdirection=Row.VStack— shorthand forStackwithdirection=Column.