Component reference
Stat
A billing snapshot with values, trends and context.
Preview
Live previewOptional six-digit hex. Clear to restore the preset. Check contrast with your brand color.
Changes apply to this preview only.
Billing snapshot
The current subscription at a glance.
Invite up to eight more teammates
Auto-renew is onactive
Width adapts to the available space
"use client";
import {
Card,
CardHeader,
CardTitle,
CardDescription,
CardContent,
Stat,
Badge
} from "@pimolu/react";
function RevenueIcon() {
return (
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth={1.8}
strokeLinecap="round"
strokeLinejoin="round"
aria-hidden="true"
>
<path d="M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" />
</svg>
);
}
function UsersIcon() {
return (
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth={1.8}
strokeLinecap="round"
strokeLinejoin="round"
aria-hidden="true"
>
<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" />
<circle cx="9" cy="7" r="4" />
<path d="M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75" />
</svg>
);
}
export function DemoExample() {
return (
<Card>
<CardHeader>
<CardTitle>Billing snapshot</CardTitle>
<CardDescription>The current subscription at a glance.</CardDescription>
</CardHeader>
<CardContent>
<div
className="grid grid-cols-[repeat(auto-fit,minmax(min(100%,280px),1fr))] gap-6 min-w-0 items-start"
>
<Stat
label="Seats"
value="12 of 20"
delta="+3"
trend="up"
description="Invite up to eight more teammates"
icon={<UsersIcon />}
size="sm"
/>
<Stat
label="Renewal"
value="19 Oct 2026"
description={<span
className="flex flex-wrap items-center gap-3 min-w-0"
>
Auto-renew is on
<Badge variant="success">active</Badge>
</span>}
icon={<RevenueIcon />}
size="sm"
/>
</div>
</CardContent>
</Card>
);
}More examples
Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.
Dashboard
Four metrics from a single reporting period, each labelled as a group.
Sizes
sm, md and lg scale the icon, the value and the supporting type together.
Trends
Up and down use success and danger tokens; neutral stays muted. The arrow and the hidden label remain when colour is unavailable.
Usage
Use label, value and supporting context consistently; distinguish period change from an absolute value.
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.
PimoluStatProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
labelRequired | string | — | Metric name, also used to label the group. |
valueRequired | ReactNode | — | Main metric value. |
delta | ReactNode | — | Change value, for example "+12.4%". |
trend | PimoluStatTrend | undefined | "neutral" | Direction of the change. Defaults to "neutral". |
description | ReactNode | — | Supporting context under the value. |
icon | ReactNode | — | Decorative leading icon. |
size | PimoluStatSize | undefined | "md" | Visual size. Defaults to "md". |
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<HTMLDivElement, Element> | undefined | — | Standard React/HTML attribute. |
onClick | MouseEventHandler<HTMLDivElement> | undefined | — | Standard React/HTML attribute. |
labelRequiredstringNo default extracted.
Metric name, also used to label the group.
valueRequiredReactNodeNo default extracted.
Main metric value.
deltaReactNodeNo default extracted.
Change value, for example "+12.4%".
trendPimoluStatTrend | undefinedDefault: "neutral"
Direction of the change. Defaults to "neutral".
descriptionReactNodeNo default extracted.
Supporting context under the value.
iconReactNodeNo default extracted.
Decorative leading icon.
sizePimoluStatSize | undefinedDefault: "md"
Visual size. Defaults to "md".
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<HTMLDivElement, Element> | undefinedNo default extracted.
Standard React/HTML attribute.
onClickMouseEventHandler<HTMLDivElement> | undefinedNo default extracted.
Standard React/HTML attribute.
Accessibility
- State the direction and meaning in text, including when a decrease is favorable.