Component reference
Grid
A responsive collection arranged in a grid.
Preview
Live previewOptional six-digit hex. Clear to restore the preset. Check contrast with your brand color.
Changes apply to this preview only.

Pimolu Studio
ShoesShips in 2–3 working days.

Canvas tote
BagsShips in 2–3 working days.

Merino cap
AccessoriesShips in 2–3 working days.
€24,180
+12.4%8,420
+4.1%1.8%
−0.3%62
+6One system, every platform
Grid on web, Stack on native: the same scale names describe the same rhythm.
Width adapts to the available space
"use client";
import {
Stack,
Grid,
Card,
CardHeader,
HStack,
CardTitle,
Badge,
CardDescription,
CardContent,
Text,
CardFooter,
Button,
Box,
Heading,
Paragraph
} from "@pimolu/react";
export function DemoExample() {
return (
<Stack gap={4}>
<Grid columns="auto-fit" minItemWidth={220} gap={4}>
{
[
{
name: "Pimolu Studio",
price: "€129",
tag: "Shoes",
},
{
name: "Canvas tote",
price: "€39",
tag: "Bags",
},
{
name: "Merino cap",
price: "€29",
tag: "Accessories",
},
].map((product) => (<Card key={product.name}>
<img
className="block w-full max-h-64 object-contain rounded-md bg-surface"
src="/images/pimolu-studio.webp"
alt={product.name}
/>
<CardHeader>
<HStack justify="between" align="center">
<CardTitle>
{product.name}
</CardTitle>
<Badge variant="secondary">
{product.tag}
</Badge>
</HStack>
<CardDescription>Ships in 2–3 working days.</CardDescription>
</CardHeader>
<CardContent>
<Text weight="semibold">
{product.price}
</Text>
</CardContent>
<CardFooter>
<Button size="sm" fullWidth>Add to cart</Button>
</CardFooter>
</Card>))
}
</Grid>
<Grid columns="auto-fit" minItemWidth={180} gap={4} align="stretch">
{
[
["Revenue", "€24,180", "+12.4%"],
["Active users", "8,420", "+4.1%"],
["Churn", "1.8%", "−0.3%"],
["NPS", "62", "+6"],
].map(([label, value, delta]) => (<Box
key={label}
padding={4}
background="surface"
>
<Stack gap={1}>
<Text size="sm" tone="muted">
{label}
</Text>
<Heading level={3} size="xl">
{value}
</Heading>
<Text size="sm" tone="success">
{delta}
</Text>
</Stack>
</Box>))
}
</Grid>
<Grid columns="auto-fit" minItemWidth={240} gap={4}>
<Box padding={6} background="surface">
<Stack gap={2}>
<Badge variant="primary">Feature</Badge>
<Heading level={3} size="lg">One system, every platform</Heading>
<Paragraph size="sm" tone="muted">
Grid on web, Stack on native: the same scale names describe the
same rhythm.
</Paragraph>
</Stack>
</Box>
<Box padding={6} background="muted">
<Stack gap={2}>
<Text size="sm" tone="muted">Track behaviour</Text>
<Text size="sm">
auto-fit removes empty tracks; auto-fill reserves them so the
layout does not jump when items are removed.
</Text>
</Stack>
</Box>
</Grid>
</Stack>
);
}More examples
Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.
Columns
A number builds repeat(n, minmax(0, 1fr)): equal tracks that never overflow their cells.
Responsive tracks
auto-fit collapses empty tracks; auto-fill keeps them. The min() guard keeps a track from overflowing a narrow container.
Gap and alignment
gap scales on the token system; align and justify drive align-items and justify-items.
Usage
Choose minimum column widths that fit the content; stack cards when they no longer fit.
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.
PimoluGridProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
as | ElementType | undefined | `div` | Element rendered by the grid. Defaults to `div`. |
columns | PimoluGridColumns | undefined | one column (CSS) | Fixed number of equal columns, or a responsive auto-fit/auto-fill track. Defaults to one column (CSS). |
minItemWidth | string | number | undefined | `16rem` (CSS) | Minimum item width for `auto-fit`/`auto-fill`. Numbers are pixels. Defaults to `16rem` (CSS). |
gap | PimoluGridSpace | undefined | `4` (16px) | Gap between rows and columns. Defaults to `4` (16px). |
align | PimoluGridAlign | undefined | — | Block-axis alignment of the items (`align-items`). |
justify | PimoluGridJustify | undefined | — | Inline-axis alignment of the items (`justify-items`). |
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 grid. Defaults to `div`.
columnsPimoluGridColumns | undefinedDefault: one column (CSS)
Fixed number of equal columns, or a responsive auto-fit/auto-fill track. Defaults to one column (CSS).
minItemWidthstring | number | undefinedDefault: `16rem` (CSS)
Minimum item width for `auto-fit`/`auto-fill`. Numbers are pixels. Defaults to `16rem` (CSS).
gapPimoluGridSpace | undefinedDefault: `4` (16px)
Gap between rows and columns. Defaults to `4` (16px).
alignPimoluGridAlign | undefinedNo default extracted.
Block-axis alignment of the items (`align-items`).
justifyPimoluGridJustify | undefinedNo default extracted.
Inline-axis alignment of the items (`justify-items`).
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
- Do not use visual placement to change the apparent reading order.