Skip to content
Playground

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

TSX
import { HStack } from "@zentara-co/zenos-ui";

hAlign distributes children horizontally and maps to Stack’s justify. vAlign aligns children vertically and maps to Stack’s align.

startItem
centerItem
betweenItem

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

PropTypeDefaultDescription
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-*.

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.