ki-stack
@kimen/elements/ki-stack- Source
- Agent reference
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.
<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
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
align | align | "baseline" | "center" | "end" | "start" | "stretch" | 'stretch' | Cross-axis alignment, stretch by default. |
direction | direction | "column" | "row" | 'column' | Main axis, column by default. |
gap | gap | "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. |
justify | justify | "between" | "center" | "end" | "start" | 'start' | Main-axis distribution, start by default. Use between to distribute spare space. |
wrap | wrap | boolean | false | Allow items to continue on a new line. Defaults to false. |
Slots
| Slot | Description |
|---|---|
| (default) | The content in reading order. A direct child with data-grow takes a share of free space. |
CSS parts
| Part | Description |
|---|---|
stack | The 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.
| Token | Description |
|---|---|
--ki-layout-spacing-md | The md spacing step for a stack or grid gap. |
--ki-stack-gap | Default gap of a stack. |
--ki-typography-family-body | semantic font family for typography family body. |