Stack Item
Controls growth, shrinkage, basis, and self-alignment inside Stack.
StackItem adjusts one child within Stack, HStack, or VStack. Use it only when that child needs growth, shrinkage, a tokenized basis, or different cross-axis alignment.
Fixed basis
Grows to fill
Import
Section titled “Import”import { Stack, StackItem } from "@zentara-co/zenos-ui";Flex sizing
Section titled “Flex sizing”grow defaults to false, while shrink defaults to true. basis sets the initial main-axis size from the shared size tokens.
<Stack direction="row"> <StackItem basis="xs" shrink={false}> Navigation </StackItem> <StackItem grow>Flexible content</StackItem> <StackItem>Actions</StackItem></Stack>Use alignSelf when one item must override the parent’s cross-axis alignment. Its values are start, center, end, stretch, and baseline.
Semantics
Section titled “Semantics”StackItem is polymorphic and retains native props and refs. When Stack is a list, render each item as li.
1. Create workspace
2. Invite members
3. Run first scan
StackItem does not need to wrap every Stack child. Plain elements participate in flex layout normally.
API
| Prop | Type | Default | Description |
|---|---|---|---|
as | ElementType | div | Rendered semantic element. |
grow | boolean | false | Allows the item to grow. |
shrink | boolean | true | Allows the item to shrink. |
basis | SizeToken | — | Initial main-axis size. |
alignSelf | AlignSelf | — | Overrides cross-axis alignment. |
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”Growth, basis, and alignment do not change semantics. Choose as to match the parent structure, and do not use flex sizing to produce a visual order that conflicts with reading or focus order.