Spacer
Spacer eats the leftover main-axis space inside a flex container. It does nothing else. Reach for it when you need to push siblings to opposite edges of a row or column.
Loading playground…
What it is
A <Box flex={1}>. Spacer accepts every Box prop, so you can override flex if you ever need a
spacer with a fractional weight. The named primitive exists because <Spacer /> at the call site
reads more clearly than <Box flex={1} />.
Install
Spacer is exported from usemotif. No separate install.
API
Spacer
stablefunction Spacer(props: SpacerProps): JSX.Element
…BoxPropsBoxProps
Every prop Box accepts. `flex` defaults to `1` and can be overridden.
Examples
Toolbar with actions pushed to the right:
Equal-width slots — give each Spacer the same flex weight: