Data
Stat & metric
A number with context and trend.
KPI row
A StatGroup with the shared variant draws one surface with hairlines between metrics. Each stat can hold a sparkline. Server Component–safe.
Monthly revenue
Active subscribers
Churn rate
p95 latency
When to use
- Headline numbers at the top of a dashboard or a detail page.
- A single number with context: the change, the period, a trend.
Not for many numbers in rows (use a table) or for the trend itself (use a chart).
Separate cards and tones
The default variant gives every stat its own card. Delta colour follows meaning, not direction: set tone when down is good (churn) or up is bad (outstanding balance), and use flat for no change.
Outstanding
Across 9 unpaid invoices
Collected
Updated 4 minutes ago
Refunds
3 refunds this month
API
StatGroup
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | 'separate' | 'shared' | 'separate' | Cards, or one surface with hairlines. |
| minItemWidth | string | '13rem' | Narrowest a stat gets before the grid wraps. |
StatDelta
| Prop | Type | Default | Description |
|---|---|---|---|
| value | ReactNode | — | The formatted change, e.g. "12.4%". |
| direction | 'up' | 'down' | 'flat' | 'up' | Arrow direction. |
| tone | 'positive' | 'negative' | 'neutral' | — | Colour; defaults from direction. |
| comparison | ReactNode | — | Context, e.g. "vs last month". |
Stat, StatLabel, StatValue, StatHelp and StatChart are plain elements that forward their props. Put an AnimatedNumber inside StatValue for a rolling number.
Accessibility
- The delta includes hidden text (“Up”, “Down”) so the arrow and colour are not the only signal.
- Give each sparkline an aria-label that says what it shows.
- Success and destructive text colours pass 4.5:1 on the surface in light and dark.
Motion
- None by default. Wrap a group in ui-stagger for a soft-rise entrance.