Officina UI
Components

Stack

Flex layout for arranging children in a row or column with consistent gap spacing.

Stack lays out its children with flexbox along a single axis. Set direction to 'row' or 'column' (the default), control spacing with the gap scale (0–8), and align items with align and justify. Pass wrap to let items flow onto multiple lines, or a divider node to render a separator between each child. It's the go-to primitive for toolbars, form rows, and vertical content groups.

Example

Preview
Live

Stack handles direction, alignment, wrapping, and gap tokens.

import { Stack } from '@officina/ui';

<Stack direction="row" gap={2} align="center" justify="between">
  <span>Title</span>
  <button>Action</button>
</Stack>;

API

PropTypeDefaultDescription
alignenumstretchCross-axis alignment of children. Defaults to `'stretch'`.
directionenumcolumnFlex direction of the stack. Defaults to `'column'`.
dividerReactNode—Element rendered between each child as a separator.
gapenum3Spacing scale between children. Defaults to `3`.
justifyenumstartMain-axis distribution of children. Defaults to `'start'`.
wrapboolean—Allow children to wrap onto multiple lines.

On this page