Vesyl UI

Stack

Flexbox stacking primitives. Stack is a thin flex container with typed direction, align, justify, and gap props — no more reaching for raw flex flex-col gap-* utilities. VStack and HStack are convenience wrappers that pin the direction (and sensible defaults) so the common cases read at a glance.

All three ship together and share one prop surface (StackProps). Anything not covered by the typed props — width, padding, background, flex-wrap — goes through className.

VStack

VStack stacks children in a column (flex-col). It defaults to align="stretch" and gap={2}, so children fill the cross axis and sit two spacing units apart unless you say otherwise.

First
Second
Third

HStack

HStack lays children out in a row (flex-row). It defaults to align="center" and gap={2} — matching the way you almost always want an icon-and-label or a button row to behave.

First
Second
Third

Stack with explicit direction

Reach for the base Stack when the direction is dynamic or you want it spelled out. direction is "vertical" (the default) or "horizontal"; VStack / HStack are just Stack with this prop locked in.

direction="vertical" (default)
One
Two
Three
direction="horizontal"
One
Two
Three

Gap

gap is a number mapped to a Tailwind gap-* class. The supported steps are 0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, and 24 — a value outside this set produces no gap class. (A string is accepted by the type but only resolves if it matches one of those keys.)

gap=2
One
Two
Three
gap=4
One
Two
Three
gap=8
One
Two
Three

Align and justify

align sets cross-axis alignment (items-*): "start", "center", "end", or "stretch". On an HStack this controls vertical alignment of children of differing heights.

align="start"
Short
Tall
Medium
align="center"
Short
Tall
Medium
align="end"
Short
Tall
Medium
align="stretch"
Short
Tall
Medium

justify sets main-axis distribution (justify-*): "start", "center", "end", "between", "around", or "evenly".

justify="start"
One
Two
Three
justify="center"
One
Two
Three
justify="end"
One
Two
Three
justify="between"
One
Two
Three
justify="around"
One
Two
Three
justify="evenly"
One
Two
Three

Reference

Stack, VStack, and HStack all share StackProps, which also extends React.HTMLAttributes<HTMLDivElement> — so any standard div attribute (id, onClick, style, …) passes through.

Stack

The base container. Renders a div by default.

PropTypeDefaultDescription
direction"vertical" | "horizontal""vertical"Flex direction (flex-col / flex-row)
align"start" | "center" | "end" | "stretch"Cross-axis alignment (items-*)
justify"start" | "center" | "end" | "between" | "around" | "evenly"Main-axis distribution (justify-*)
gapnumber | stringGap between items. Supported: 06, 8, 10, 12, 16, 20, 24
asReact.ElementType"div"Render as a different element
classNamestringMerged after the variant + gap classes
refReact.Ref<HTMLDivElement>Forwarded to the rendered element

VStack

Stack locked to a column. Accepts every StackProps field except direction.

PropTypeDefaultDescription
align"start" | "center" | "end" | "stretch""stretch"Cross-axis alignment
gapnumber | string2Gap between items (same scale as Stack)

HStack

Stack locked to a row. Accepts every StackProps field except direction.

PropTypeDefaultDescription
align"start" | "center" | "end" | "stretch""center"Cross-axis alignment
gapnumber | string2Gap between items (same scale as Stack)