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
Import
Section titled “Import”import { Stack, StackItem } from "@zentara-co/zenos-ui";Responsive direction
Section titled “Responsive direction”Stack uses column by default. Its direction accepts only row and column, either directly or through a responsive object.
<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.
Wrapping and spacing
Section titled “Wrapping and spacing”gap, align, justify, wrap, and every padding prop accept responsive values. Wrap accepts booleans as shorthand, plus nowrap, wrap, and wrap-reverse.
Logical padding props such as paddingInlineStart and paddingBlockEnd adapt to writing direction. More specific padding classes can override general padding at the same breakpoint.
Sizing and scrolling
Section titled “Sizing and scrolling”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
Semantics
Section titled “Semantics”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
| Prop | Type | Default | Description |
|---|---|---|---|
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-*.
Accessibility
Section titled “Accessibility”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.