Skip to content

Stack

A flex container that lays its children out in one direction with a gap.

Group: Layout · Kind: macro · in the lite catalog

example
ALAda Lovelace
Owner
direction · vertical
ALAda Lovelace
Owner

Open in the playground

The same specimen painted by React, SwiftUI, Compose and gpui.

exponential-ui-stack on Web
exponential-ui-stack on iOS
exponential-ui-stack on Android
exponential-ui-stack on Desktop
wrap
ALAda Lovelace
Owner
Prop Type Required Bindable Description
direction horizontal | vertical – yes A row or a column ({base: "vertical", md: "horizontal"}). Default "vertical". Responsive: takes a per-breakpoint object.
gap none | xs | sm | md | lg | xl – – The space between children. Default "md". Responsive: takes a per-breakpoint object.
align start | center | end | stretch – yes Unset: center in a row, stretch in a column. Responsive: takes a per-breakpoint object.
justify start | center | end | between | around | evenly – yes Main-axis distribution. Default "start". Responsive: takes a per-breakpoint object.
wrap boolean – – Lets children wrap onto new lines. Default false. Responsive: takes a per-breakpoint object.
style style – – Extra Box styles merged over the stack’s own.

None.

None.

many

The basic catalog’s Row, Column render as Stack.

Box

Role: none

none (layout only)

Not focusable; no keys.

Recipe parts: Stack/root

Keyed by: :hover :pressed :focus :disabled :checked :open :selected :invalid :dragover

Themes · Write a theme

Box · Grid · Card · Separator · List · Resizable · ScrollArea · Sidebar