HStack
A horizontal Stack convenience primitive with logical-axis alignment.
HStack is Stack with a fixed horizontal direction. It adds hAlign and vAlign aliases so alignment can be described in visual axes.
Workspace
24 members
Import
Section titled “Import”import { HStack } from "@zentara-co/zenos-ui";Logical alignment
Section titled “Logical alignment”hAlign distributes children horizontally and maps to Stack’s justify. vAlign aligns children vertically and maps to Stack’s align.
The shared align and justify props remain available and take precedence over the aliases when both are supplied. HStack also supports Stack’s responsive gap, wrapping, padding, size constraints, scrolling, polymorphism, and native props.
Use Cluster when the main requirement is a wrapping row of related items. Use HStack when distribution, sizing, or the complete Stack API matters.
API
| Prop | Type | Default | Description |
|---|---|---|---|
as | ElementType | div | Rendered semantic element. |
hAlign | Responsive<Justify> | — | Horizontal distribution. |
vAlign | Responsive<Align> | — | Vertical alignment. |
gap | Responsive<Spacing> | 4 | Space between children. |
wrap | Responsive<boolean | FlexWrap> | false | Wrapping behavior. |
shared Stack props | padding*, size constraints, isScrollable | — | HStack supports Stack spacing, sizing, scrolling, and native props. |
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”HStack does not add semantics or reorder children. Choose as for the content and keep the source order meaningful when using hAlign="end", between, or evenly.