Stack

One-dimensional stacking with a consistent gap — plus the HStack and VStack presets.

Design review at 10:00

Ship the docs site

Water the plants

Import#

import { Stack, HStack, VStack } from "astralis-ui";

Usage#

Stack is the shorthand for the most common flex layout: children in one direction with even spacing. VStack stacks vertically, HStack lays out horizontally and centers its children on the cross axis — usually what you want for rows of mixed-height content.

Orbit weekly

12 unread updates

Direction#

The base Stack takes a direction prop if you'd rather not pick a preset.

vertical (default)

One

Two

horizontal

One

Two

For two-dimensional layouts or per-child control, step up to Flex or Grid.

Props#

Stack extends Flex (and therefore Box).

PropTypeDefaultDescription
direction"horizontal" | "vertical""vertical"Stacking axis. HStack and VStack are presets with this fixed (HStack also defaults alignItems to center).
gap"0.5" – "96" (spacing scale)Space between children.
alignItems · justifyContent · wrap …Flex propsStack is a Flex preset — every Flex and Box prop works.