Layout

Stack

Lays children out in a row or column with a consistent token-backed gap. The agnostic replacement for inline flex and gap styles.

Examples

Row with gap
Loading preview
<Stack direction="row" spacing="12px">...</Stack>

API

PropTypeDefaultDescription
direction'row' | 'column'columnLayout direction.
spacingSpacingScale | string0Gap between items.
align'start' | 'center' | 'end' | 'stretch'stretchCross-axis alignment.
justify'start' | 'center' | 'end' | 'between' | 'around'startMain-axis distribution.

Guidelines

Do

  • Use Stack for one-dimensional layouts instead of raw flexbox.

Avoid

  • Do not hardcode gap with margins; use the spacing prop.

Import from @hub/ds-components. Interactive playground: Storybook. Figma Code Connect node 299-139.