- Docs
- Components
- Layout
Stack
A vertical flow with a gap from the space scale. The one way to space things above each other.
- Import
- @qeetrix/react
- Status
- StableSince 0.0.2
- Renders
<div>Server-rendered- Tested
- WCAG 2.2 AAaxe on every pull request
01
Import
// From the package: a build keeps only what it uses.
import { Stack } from "@qeetrix/react";
// Or from its own path.
import { Stack } from "@qeetrix/react/stack";02
Props
And every native attribute of the element it renders.
| Prop | Type | Default | What it does |
|---|---|---|---|
gap | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "md" | Space between children: 0 · 4 · 8 · 12 · 16 · 24 · 32 · 48 · 64px. |
align | "start" | "center" | "end" | "stretch" | "stretch" | Across. |
justify | "start" | "center" | "end" | "between" | — | Along, in a taller stack. |
render | ReactElement | a <div> | A <ul> around <li>: bullets go, the list stays. |
03
Parts
Each part carries a data-slot, for tests and placement.
| data-slot | Element | What it is |
|---|---|---|
stack | <div> | data-gap, data-align, data-justify. |
04
A form's gaps
Fields stand the form gap apart; Form does it for you.
<Stack gap="lg">
<TextField label="Email" />
<Select label="Role" items={roles} />
</Stack>