Stack
Stack is the named flex container. It exists so common spacing setups read clearly at the call
site without juggling display, flexDirection, and gap props every time.
What it is
A <Box display="flex"> with a direction prop. Stack composes through Box, so every style prop,
every responsive key, every pseudo-state applies — gap is the prop you reach for most.
Install
Stack is exported from usemotif. No separate install.
API
Stack
stablefunction Stack(props: StackProps): JSX.Element
Flex direction. Use `HStack` for `"row"` or `VStack` for `"column"` if you prefer the named shorthand.
Every prop Box accepts — minus `display` and `flexDirection`, which Stack manages.
gap, alignItems, justifyContent, flexWrap, every other flex-related style prop comes from
Box. They work normally.
Examples
Simple vertical stack:
Horizontal row with the direction prop:
For horizontal layouts you reach for often, the HStack shorthand reads more clearly:
Responsive direction — column on phones, row on desktops: