Skip to content

H Stack

@astryxdesign/core v0.7.1 · HStack

Props ​

HStack takes every Stack prop except direction, which is fixed to horizontal.

PropTypeDefaultDescription
alignStackCrossAlignment—Vertical alignment alias, so the prop reads the same as on Stack. Same as vAlign.
asstring | Component'div'Element or component rendered at the root.
gapSpacingStep—Space between adjacent items, using the spacing scale.
heightnumber | string—Height of the row. Numbers are pixels, strings are used as they are.
hAlignStackMainAlignment—Horizontal main-axis alignment of the items: start, center, end, between, around, or evenly.
isScrollablebooleanfalseEnables scrollable overflow.
justifyStackMainAlignment—Main-axis alignment alias. Mirrors CSS justify-content.
maxWidthnumber | string—Maximum width of the row.
minHeightnumber | string—Minimum height of the row.
paddingSpacingStep—Padding on both axes, using the spacing scale.
paddingBlockSpacingStep—Block-axis padding. Overrides padding on this axis.
paddingBlockEndSpacingStep—Bottom padding. Overrides paddingBlock and padding on that edge only.
paddingBlockStartSpacingStep—Top padding. Overrides paddingBlock and padding on that edge only.
paddingInlineSpacingStep—Inline-axis padding. Overrides padding on this axis.
paddingInlineEndSpacingStep—Inline-end padding (right in LTR). Overrides paddingInline and padding on that edge only.
paddingInlineStartSpacingStep—Inline-start padding (left in LTR). Overrides paddingInline and padding on that edge only.
vAlignStackCrossAlignment—Vertical cross-axis alignment of the items: start, center, end, or stretch.
widthnumber | string—Width of the row. Numbers are pixels, strings are used as they are.
wrapStackWrap'nowrap'Whether the items wrap onto another line: nowrap, wrap, or wrap-reverse.

The helper types are shared with Stack:

ts
type SpacingStep = 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10
type StackMainAlignment = 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'
type StackCrossAlignment = 'start' | 'center' | 'end' | 'stretch'
type StackWrap = 'nowrap' | 'wrap' | 'wrap-reverse'
type StackSizeValue = number | string
type StackElement = Component | string

Slots ​

  • default: the items in the row.

Native attributes ​

The root element receives HTML attributes, aria-* attributes, data-* attributes, class, and style. class is merged with the component's own classes and style is merged with the sizing and spacing it already writes.