Stack

stable 0.5 kB
<hk-stack>

Flex row or column with token-driven gaps. The layout primitive you reach for before writing another one-off flex utility.

#flex#spacing

Live demo

Running in this page — interact with it.

Inputs

NameTypeDefaultDescription
direction'row' | 'column''column'Main axis.
gapstring'0.5rem'Space between children.
align'start' | 'center' | 'end' | 'stretch''stretch'Cross-axis alignment.
justify'start' | 'center' | 'end' | 'between''start'Main-axis distribution.
wrapbooleanfalseAllows children to wrap.

Theming

Component tokens, each falling back to a global one:

PropertyDefaultControls
--hk-stack-gap0.5remDefault gap when none is passed.

Accessibility

  • Purely presentational: it adds no roles and does not disturb the reading order of its children.

More in Layout