Skip to content
Playground

Stack

Arrange siblings along one responsive axis with typed spacing, alignment, and sizing.

Stack arranges siblings in a row or column. Its direction, spacing, alignment, distribution, wrapping, and padding can adapt at Zenos breakpoints.

  • Production workspace

    12 services monitored

TSX
import { Stack, StackItem } from "@zentara-co/zenos-ui";

Stack uses column by default. Its direction accepts only row and column, either directly or through a responsive object.

TSX
<Stack direction={{ base: "column", md: "row" }} gap="4">  ...</Stack>

Use HStack or VStack when the direction is fixed and logical-axis alignment reads more clearly.

gap, align, justify, wrap, and every padding prop accept responsive values. Wrap accepts booleans as shorthand, plus nowrap, wrap, and wrap-reverse.

AuthenticationInfrastructureData protectionObservability

Logical padding props such as paddingInlineStart and paddingBlockEnd adapt to writing direction. More specific padding classes can override general padding at the same breakpoint.

Stack supports tokenized width, height, minimum, and maximum constraints. isScrollable adds overflow scrolling and is most useful with a constrained height or width.

Activity item 1

Activity item 2

Activity item 3

Activity item 4

Activity item 5

Activity item 6

Activity item 7

Activity item 8

Use as="ul" with list-item children for ordered collections, as="nav" for navigation, or another element that matches the content. Native props and refs follow the selected element.

API

PropTypeDefaultDescription
as ElementType div Rendered semantic element.
direction Responsive<row | column> column Responsive main axis.
align / justify Responsive<Align | Justify> — Cross-axis alignment and main-axis distribution.
gap Responsive<Spacing> 4 Space between children.
wrap Responsive<boolean | nowrap | wrap | wrap-reverse> false Responsive flex wrapping.
padding / paddingX / paddingY / logical padding props Responsive<Spacing> — Physical and logical responsive padding.
width / height / minWidth / maxWidth / minHeight / maxHeight SizeToken — Structural size constraints.
isScrollable boolean false Enables overflow scrolling within a constrained Stack.
native props React.HTMLAttributes<HTMLElement> — Forwards native attributes, events, aria-*, data-*, className, style, and ref.

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

Responsive direction changes presentation without changing source order. Keep DOM order meaningful for reading and keyboard navigation. Independently scrollable stacks need a visible size constraint and must remain usable at 200% zoom.