Component reference
Stack
A notification composition with consistent spacing.
Preview
Live previewOptional six-digit hex. Clear to restore the preset. Check contrast with your brand color.
Changes apply to this preview only.
Notification settings
Rows with a label, a hint and an action.
Article layout
A vertical stack with a horizontal meta row.
Compose instead of override
Layout primitives keep spacing on the token scale. When a page needs a new rhythm, the scale gains a step rather than the page gaining a magic number.
Checkout summary
HStack with a spacer keeps the total on the right.
Width adapts to the available space
"use client";
import {
Card,
CardHeader,
CardTitle,
CardDescription,
CardContent,
VStack,
HStack,
Text,
Spacer,
Button,
Badge,
Heading,
Paragraph
} from "@pimolu/react";
export function DemoExample() {
return (
<div
className="grid grid-cols-[repeat(auto-fit,minmax(min(100%,280px),1fr))] gap-6 min-w-0 items-start"
>
<Card>
<CardHeader>
<CardTitle>Notification settings</CardTitle>
<CardDescription>Rows with a label, a hint and an action.</CardDescription>
</CardHeader>
<CardContent>
<VStack gap={4}>
{
[
[
"Product updates",
"A short summary every Friday.",
],
[
"Security alerts",
"Sign-ins from a new device.",
],
[
"Billing",
"Invoices and failed payments.",
],
].map(([title, description]) => (<HStack
key={title}
gap={3}
align="start"
>
<VStack gap={1}>
<Text weight="medium">
{title}
</Text>
<Text size="sm" tone="muted">
{description}
</Text>
</VStack>
<Spacer />
<Button size="sm" appearance="outline">Manage</Button>
</HStack>))
}
</VStack>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Article layout</CardTitle>
<CardDescription>A vertical stack with a horizontal meta row.</CardDescription>
</CardHeader>
<CardContent>
<VStack gap={3} align="start">
<Badge variant="primary">Guide</Badge>
<Heading level={3} size="lg">Compose instead of override</Heading>
<Paragraph size="sm" tone="muted">
Layout primitives keep spacing on the token scale. When a page
needs a new rhythm, the scale gains a step rather than the page
gaining a magic number.
</Paragraph>
<HStack gap={2} align="center">
<Text size="sm" weight="medium">Amélie Bernard</Text>
<Text size="sm" tone="muted">·</Text>
<Text size="sm" tone="muted">6 min read</Text>
</HStack>
</VStack>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Checkout summary</CardTitle>
<CardDescription>
HStack with a spacer keeps the total on the right.
</CardDescription>
</CardHeader>
<CardContent>
<VStack gap={3}>
<HStack justify="between">
<Text size="sm" tone="muted">Subtotal</Text>
<Text size="sm">€148</Text>
</HStack>
<HStack justify="between">
<Text size="sm" tone="muted">Shipping</Text>
<Text size="sm">€9</Text>
</HStack>
<HStack align="center">
<Text weight="medium">Total</Text>
<Spacer />
<Text weight="semibold">€157</Text>
</HStack>
<Button fullWidth>Pay securely</Button>
</VStack>
</CardContent>
</Card>
</div>
);
}More examples
Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.
Direction
Explore direction with Stack.
Gap scale
Every step uses --pimolu-spacing-*: 0, 1, 2, 3, 4, 6, 8 and 12.
Alignment and justification
align works on the cross axis, justify on the main axis. The demo uses a centered 160px-tall stage.
Usage
Use horizontal/vertical stacks to express content flow and let them wrap where appropriate.
API reference
Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.
PimoluStackProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
as | ElementType | undefined | `div` | Element rendered by the stack. Defaults to `div`. |
direction | PimoluStackDirection | undefined | `column`; HStack/VStack fix it | Main axis. Defaults to `column`; HStack/VStack fix it. |
gap | PimoluStackSpace | undefined | `3` (12px) | Gap between children. Defaults to `3` (12px). |
align | PimoluStackAlign | undefined | — | Cross-axis alignment. |
justify | PimoluStackJustify | undefined | — | Main-axis distribution. |
wrap | boolean | undefined | false | Allow children to wrap onto several lines. |
fullWidth | boolean | undefined | false | Fill the available inline size. |
defaultValue | string | number | readonly string[] | undefined | — | Standard React/HTML attribute. |
className | string | undefined | — | Standard React/HTML attribute. |
style | CSSProperties | undefined | — | Standard React/HTML attribute. |
aria-label | string | undefined | — | Defines a string value that labels the current element. |
children | ReactNode | — | Standard React/HTML attribute. |
onChange | ChangeEventHandler<HTMLElement, Element> | undefined | — | Standard React/HTML attribute. |
onClick | MouseEventHandler<HTMLElement> | undefined | — | Standard React/HTML attribute. |
asElementType | undefinedDefault: `div`
Element rendered by the stack. Defaults to `div`.
directionPimoluStackDirection | undefinedDefault: `column`; HStack/VStack fix it
Main axis. Defaults to `column`; HStack/VStack fix it.
gapPimoluStackSpace | undefinedDefault: `3` (12px)
Gap between children. Defaults to `3` (12px).
alignPimoluStackAlign | undefinedNo default extracted.
Cross-axis alignment.
justifyPimoluStackJustify | undefinedNo default extracted.
Main-axis distribution.
wrapboolean | undefinedDefault: false
Allow children to wrap onto several lines.
fullWidthboolean | undefinedDefault: false
Fill the available inline size.
defaultValuestring | number | readonly string[] | undefinedNo default extracted.
Standard React/HTML attribute.
classNamestring | undefinedNo default extracted.
Standard React/HTML attribute.
styleCSSProperties | undefinedNo default extracted.
Standard React/HTML attribute.
aria-labelstring | undefinedNo default extracted.
Defines a string value that labels the current element.
childrenReactNodeNo default extracted.
Standard React/HTML attribute.
onChangeChangeEventHandler<HTMLElement, Element> | undefinedNo default extracted.
Standard React/HTML attribute.
onClickMouseEventHandler<HTMLElement> | undefinedNo default extracted.
Standard React/HTML attribute.
PimoluHStackProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
onChange | ChangeEventHandler<HTMLElement, Element> | undefined | — | Standard React/HTML attribute. |
defaultValue | string | number | readonly string[] | undefined | — | Standard React/HTML attribute. |
className | string | undefined | — | Standard React/HTML attribute. |
style | CSSProperties | undefined | — | Standard React/HTML attribute. |
aria-label | string | undefined | — | Defines a string value that labels the current element. |
children | ReactNode | — | Standard React/HTML attribute. |
onClick | MouseEventHandler<HTMLElement> | undefined | — | Standard React/HTML attribute. |
fullWidth | boolean | undefined | false | Fill the available inline size. |
as | ElementType | undefined | `div` | Element rendered by the stack. Defaults to `div`. |
gap | PimoluStackSpace | undefined | `3` (12px) | Gap between children. Defaults to `3` (12px). |
align | PimoluStackAlign | undefined | — | Cross-axis alignment. |
justify | PimoluStackJustify | undefined | — | Main-axis distribution. |
wrap | boolean | undefined | false | Allow children to wrap onto several lines. |
onChangeChangeEventHandler<HTMLElement, Element> | undefinedNo default extracted.
Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefinedNo default extracted.
Standard React/HTML attribute.
classNamestring | undefinedNo default extracted.
Standard React/HTML attribute.
styleCSSProperties | undefinedNo default extracted.
Standard React/HTML attribute.
aria-labelstring | undefinedNo default extracted.
Defines a string value that labels the current element.
childrenReactNodeNo default extracted.
Standard React/HTML attribute.
onClickMouseEventHandler<HTMLElement> | undefinedNo default extracted.
Standard React/HTML attribute.
fullWidthboolean | undefinedDefault: false
Fill the available inline size.
asElementType | undefinedDefault: `div`
Element rendered by the stack. Defaults to `div`.
gapPimoluStackSpace | undefinedDefault: `3` (12px)
Gap between children. Defaults to `3` (12px).
alignPimoluStackAlign | undefinedNo default extracted.
Cross-axis alignment.
justifyPimoluStackJustify | undefinedNo default extracted.
Main-axis distribution.
wrapboolean | undefinedDefault: false
Allow children to wrap onto several lines.
PimoluVStackProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
onChange | ChangeEventHandler<HTMLElement, Element> | undefined | — | Standard React/HTML attribute. |
defaultValue | string | number | readonly string[] | undefined | — | Standard React/HTML attribute. |
className | string | undefined | — | Standard React/HTML attribute. |
style | CSSProperties | undefined | — | Standard React/HTML attribute. |
aria-label | string | undefined | — | Defines a string value that labels the current element. |
children | ReactNode | — | Standard React/HTML attribute. |
onClick | MouseEventHandler<HTMLElement> | undefined | — | Standard React/HTML attribute. |
fullWidth | boolean | undefined | false | Fill the available inline size. |
as | ElementType | undefined | `div` | Element rendered by the stack. Defaults to `div`. |
gap | PimoluStackSpace | undefined | `3` (12px) | Gap between children. Defaults to `3` (12px). |
align | PimoluStackAlign | undefined | — | Cross-axis alignment. |
justify | PimoluStackJustify | undefined | — | Main-axis distribution. |
wrap | boolean | undefined | false | Allow children to wrap onto several lines. |
onChangeChangeEventHandler<HTMLElement, Element> | undefinedNo default extracted.
Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefinedNo default extracted.
Standard React/HTML attribute.
classNamestring | undefinedNo default extracted.
Standard React/HTML attribute.
styleCSSProperties | undefinedNo default extracted.
Standard React/HTML attribute.
aria-labelstring | undefinedNo default extracted.
Defines a string value that labels the current element.
childrenReactNodeNo default extracted.
Standard React/HTML attribute.
onClickMouseEventHandler<HTMLElement> | undefinedNo default extracted.
Standard React/HTML attribute.
fullWidthboolean | undefinedDefault: false
Fill the available inline size.
asElementType | undefinedDefault: `div`
Element rendered by the stack. Defaults to `div`.
gapPimoluStackSpace | undefinedDefault: `3` (12px)
Gap between children. Defaults to `3` (12px).
alignPimoluStackAlign | undefinedNo default extracted.
Cross-axis alignment.
justifyPimoluStackJustify | undefinedNo default extracted.
Main-axis distribution.
wrapboolean | undefinedDefault: false
Allow children to wrap onto several lines.
Accessibility
- Ensure the visual order matches the DOM reading and keyboard order.