Component reference
Flex
A flexible toolbar that adapts to available space.
Preview
Live previewOptional six-digit hex. Clear to restore the preset. Check contrast with your brand color.
Changes apply to this preview only.
Toolbar
The actions stay on the right at every width.
Projects
Media object
A fixed thumbnail next to fluid text.

Split layout
Two equal panes with a token gap.
Primary pane: grows from a zero basis, so both sides stay equal.
Secondary pane: same rule, same width.
Width adapts to the available space
"use client";
import {
Card,
CardHeader,
CardTitle,
CardDescription,
CardContent,
Flex,
Heading,
Spacer,
Button,
Stack,
Text,
HStack,
Badge,
Box,
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>Toolbar</CardTitle>
<CardDescription>The actions stay on the right at every width.</CardDescription>
</CardHeader>
<CardContent>
<Flex gap={2} align="center" wrap fullWidth>
<Heading level={3} size="md">Projects</Heading>
<Spacer />
<Button size="sm" appearance="outline">Filter</Button>
<Button size="sm">New project</Button>
</Flex>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Media object</CardTitle>
<CardDescription>A fixed thumbnail next to fluid text.</CardDescription>
</CardHeader>
<CardContent>
<Flex gap={3} align="start">
<img
className="block w-full max-h-64 object-contain rounded-md bg-surface"
src="/images/pimolu-studio.webp"
alt="Pimolu Studio headphones with the p emblem"
width={96}
height={96}
style={{
width: 96,
height: 96,
flex: "0 0 96px",
}}
/>
<Stack gap={1}>
<Text weight="medium">Pimolu Studio</Text>
<Text size="sm" tone="muted">
Lightweight sneaker for everyday runs. The text takes the
remaining width and wraps instead of pushing the image.
</Text>
<HStack gap={2} align="center">
<Badge variant="success">In stock</Badge>
<Text size="sm">€129</Text>
</HStack>
</Stack>
</Flex>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Split layout</CardTitle>
<CardDescription>Two equal panes with a token gap.</CardDescription>
</CardHeader>
<CardContent>
<Flex gap={4} align="stretch">
<Flex grow={1} basis={0}>
<Box padding={4} background="muted" fullWidth>
<Paragraph size="sm">
Primary pane: grows from a zero basis, so both sides stay equal.
</Paragraph>
</Box>
</Flex>
<Flex grow={1} basis={0}>
<Box padding={4} background="muted" fullWidth>
<Paragraph size="sm">Secondary pane: same rule, same width.</Paragraph>
</Box>
</Flex>
</Flex>
</CardContent>
</Card>
</div>
);
}More examples
Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.
Direction
row (default), row-reverse, column and column-reverse.
Alignment
align-items on the cross axis.
Justification
justify-content on the main axis, from start to space-evenly.
Usage
Use wrapping rather than squeezing labels or clipping actions.
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.
PimoluFlexProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
as | ElementType | undefined | `div` | Element rendered by the flex container. Defaults to `div`. |
direction | PimoluFlexDirection | undefined | `row` | Main axis. Defaults to `row`. |
align | PimoluFlexAlign | undefined | — | Cross-axis alignment. |
justify | PimoluFlexJustify | undefined | — | Main-axis distribution. |
wrap | boolean | undefined | false | Allow children to wrap onto several lines. |
gap | PimoluFlexSpace | undefined | `0` | Gap between children. Defaults to `0`. |
grow | number | undefined | — | `flex-grow` of the container inside its own parent. |
shrink | number | undefined | — | `flex-shrink` of the container inside its own parent. |
basis | string | number | undefined | — | `flex-basis` of the container; numbers are pixels. |
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 flex container. Defaults to `div`.
directionPimoluFlexDirection | undefinedDefault: `row`
Main axis. Defaults to `row`.
alignPimoluFlexAlign | undefinedNo default extracted.
Cross-axis alignment.
justifyPimoluFlexJustify | undefinedNo default extracted.
Main-axis distribution.
wrapboolean | undefinedDefault: false
Allow children to wrap onto several lines.
gapPimoluFlexSpace | undefinedDefault: `0`
Gap between children. Defaults to `0`.
grownumber | undefinedNo default extracted.
`flex-grow` of the container inside its own parent.
shrinknumber | undefinedNo default extracted.
`flex-shrink` of the container inside its own parent.
basisstring | number | undefinedNo default extracted.
`flex-basis` of the container; numbers are pixels.
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.
Accessibility
- Keep source order logical and verify all controls remain reachable at narrow widths.