Flex
Flex is a <Box display="flex"> with an optional direction prop. Distinct from Stack: Flex has no
opinion on gap, so reach for it when the layout wants flex semantics but not Stack's spacing
defaults.
What it is
A thin wrapper over Box that sets display: flex. Every Box style prop applies — including
gap, when you want it explicitly — and direction maps to flexDirection. Stack is the better
choice when the layout reads as "items with consistent spacing between them"; Flex is the better
choice when the layout uses flex for alignment or sizing but doesn't need a spacing convention.
Install
Flex is exported from usemotif. No separate install.
API
Flex
stablefunction Flex(props: FlexProps): JSX.Element
Maps to `flexDirection`. Optional — when omitted, the renderer uses its default (web: `row`).
Every prop Box accepts. `display` is managed by Flex.
Examples
Single-row layout with a Spacer:
Flex column without Stack's gap convention: