Stack

Vertical

Children run top to bottom, 16px apart. Use it to lay out page sections or forms without margins.

First line

Second line

Third line

Row: data-direction="row"

Lays children out in a row, centered vertically, and wraps when space runs out. Good for button groups or badges.

Gap sizes: data-gap

sm 8px, default 16px, lg 32px

sm · 8px New Bestseller Sale
Default · 16px New Bestseller Sale
lg · 32px New Bestseller Sale

Nested in a form

Stacks can nest, such as a vertical form with a row of buttons at the bottom.

Attributes

Attribute / element Values Description
.stack Vertical flex with 16px between children. Works on any element (div, form, section ...)
data-direction row; omit for vertical (default) Horizontal, wraps, and centers items vertically
data-gap sm, lg; omit for 16px (default) 8px or 32px gap