Skip to content
Kimenpre-v1documentation home
Color scheme

ki-stack

Use a stack for a vertical sequence or a horizontal toolbar. Set align on the cross axis, justify on the main axis and wrap to allow another line. A direct child with data-grow takes a share of the available space.

Theme for this example
Color scheme for this example
Order summary Cancel Save
<ki-stack direction="row" gap="sm" align="center" wrap>
<strong data-grow>Order summary</strong>
<ki-button variant="secondary">Cancel</ki-button>
<ki-button variant="primary">Save</ki-button>
</ki-stack>

The stack preserves the reading and focus order of its children, including in right-to-left layouts. Use a card for a grouping with a visible surface. Use navigation or a sidebar for a page shell.

API reference

When to use: arrange content in a vertical sequence or a horizontal row with consistent token spacing.

When not to use: for page shells, painted grouping (use ki-card), or tabular data.

Properties & attributes

AttributePropertyTypeDefaultDescription
alignalign"baseline" | "center" | "end" | "start" | "stretch"'stretch'Cross-axis alignment, stretch by default.
directiondirection"column" | "row"'column'Main axis, column by default.
gapgap"10xl" | "11xl" | "12xl" | "13xl" | "14xl" | "15xl" | "16xl" | "17xl" | "18xl" | "19xl" | "20xl" | "21xl" | "22xl" | "23xl" | "24xl" | "25xl" | "26xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | "lg" | "md" | "sm" | "xl" | "xs" | "xxs" | "zero"'md'Kimen spacing step, md by default. Unsupported values keep the default gap.
justifyjustify"between" | "center" | "end" | "start"'start'Main-axis distribution, start by default. Use between to distribute spare space.
wrapwrapbooleanfalseAllow items to continue on a new line. Defaults to false.

Slots

SlotDescription
(default)The content in reading order. A direct child with data-grow takes a share of free space.

CSS parts

PartDescription
stackThe flex layout containing the slotted content.

CSS custom properties

The public styling contract of ki-stack: reassign these tokens at :root or on a subtree — never override internals.

TokenDescription
--ki-layout-spacing-mdThe md spacing step for a stack or grid gap.
--ki-stack-gapDefault gap of a stack.
--ki-typography-family-bodysemantic font family for typography family body.

Workshop

Open ki-stack in Storybook