Key figures in a row
import { Stat, StatGroup } from "@senvenli/react/display";
export default function Example() {
return (
<StatGroup aria-label="March 2026">
<Stat label="Revenue" value="$48,920" delta={{ value: "12.4%", direction: "up" }} comparison="vs. February" />
{/* Fewer refunds is good news, so the fall is marked positive. */}
<Stat label="Refunds" value="18" delta={{ value: "25%", direction: "down", isPositive: true }} comparison="vs. February" />
<Stat label="New customers" value="312" delta={{ value: "0%", direction: "flat" }} comparison="vs. February" />
</StatGroup>
);
}import { Stat, StatGroup } from "@senvenli/react/display";Examples
With a sparkline
A short series under the figure shows the shape of the period.import { Stat } from "@senvenli/react/display";
const WEEKLY_ORDERS = [112, 126, 119, 138, 151, 147, 163, 172];
export default function Example() {
return (
<div className="max-w-xs">
<Stat label="Orders" value="1,128" delta={{ value: "8.1%", direction: "up" }} comparison="vs. the previous 8 weeks" trend={WEEKLY_ORDERS} />
</div>
);
}A stat that is a link
The whole tile opens the report behind the figure.import { Stat } from "@senvenli/react/display";
export default function Example() {
return (
<div className="max-w-xs">
<Stat label="Open invoices" value="$12,480" delta={{ value: "4.2%", direction: "up", isPositive: false }} comparison="vs. February" href="#" />
</div>
);
}Guidelines
When to use it
- A dashboard's headline numbers.
Use something else when
- Several labeled facts about one record. Description list
Accessibility
Built in
- The change is announced in words, not only by its arrow and color.
- Figures keep their formatted order in right-to-left pages.
You provide
- A formatted value and, next to a change, the period it compares against.
API reference
Stat
| Prop | Type | Default | Description |
|---|---|---|---|
labelRequired | React.ReactNode | – | |
valueRequired | React.ReactNode | – | The figure, already formatted with Intl ("$48,920"). |
delta | StatDelta | – | |
comparison | React.ReactNode | – | The period the delta compares against ("vs. September"); required next to a delta. |
trend | number[] | – | A short series for the sparkline. |
href | string | – | Makes the whole tile a link to the report behind it. |
labelRequiredReact.ReactNodevalueRequiredReact.ReactNodeThe figure, already formatted with Intl ("$48,920").
deltaStatDeltacomparisonReact.ReactNodeThe period the delta compares against ("vs. September"); required next to a delta.
trendnumber[]A short series for the sparkline.
hrefstringMakes the whole tile a link to the report behind it.
StatGroup
| Prop | Type | Default | Description |
|---|---|---|---|
childrenRequired | React.ReactNode | – | |
aria-label | string | – |
childrenRequiredReact.ReactNodearia-labelstring