Skip to content

Stack

Stack Props ​

NameTypeDefaultDescription
direction'horizontal' | 'vertical''vertical'Direction in which children are arranged.
gapSpacingStep—Space between adjacent children.
paddingSpacingStep—Padding on every side of the container.
paddingInlineSpacingStep—Inline-axis padding. Overrides padding on this axis.
paddingBlockSpacingStep—Block-axis padding. Overrides padding on this axis.
hAlignStackAlignment—Controls horizontal main- or cross-axis alignment according to direction.
vAlignStackAlignment—Controls vertical main- or cross-axis alignment according to direction.
justifyStackMainAlignment—Alias for main-axis alignment.
alignStackCrossAlignment—Alias for cross-axis alignment.
wrap'nowrap' | 'wrap' | 'wrap-reverse''nowrap'Controls how children wrap.
widthnumber | string—Container width. Numbers are interpreted as pixels.
heightnumber | string—Container height. Numbers are interpreted as pixels.
maxWidthnumber | string—Maximum container width.
minHeightnumber | string—Minimum container height.
isScrollablebooleanfalseEnables automatic overflow scrolling.
asstring | Component'div'Root element or Vue component.

SpacingStep accepts these values:

ts
type SpacingStep = 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10

HStack Props ​

HStack uses a fixed horizontal direction.

  • The component supports shared Stack props.
  • The component does not expose direction.
  • The table below defines alignment.
NameTypeDefaultDescription
hAlignStackMainAlignment—Horizontal main-axis alignment.
vAlignStackCrossAlignment'stretch'Vertical cross-axis alignment.

VStack Props ​

VStack uses a fixed vertical direction.

  • The component supports shared Stack props.
  • The component does not expose direction.
  • The table below defines alignment.
NameTypeDefaultDescription
hAlignStackCrossAlignment'stretch'Horizontal cross-axis alignment.
vAlignStackMainAlignment—Vertical main-axis alignment.

StackItem Props ​

NameTypeDefaultDescription
size'static' | 'fill''static'Keeps the intrinsic size or fills the remaining space.
crossAlignSelf'start' | 'center' | 'end' | 'stretch'—Overrides cross-axis alignment for this item.
isScrollablebooleanfalseEnables automatic overflow scrolling.
asstring | Component'div'Root element or Vue component.

Slots ​

Stack, HStack, VStack, and StackItem all receive content through the default slot.

Native attributes ​

The root element receives:

  • HTML attributes.
  • aria-* attributes.
  • data-* attributes.
  • class.
  • style.
  • Native event listeners.