ui-kit0.0

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

$47,210
Up 12.4%vs last month

Active subscribers

4,360
Up 4.1%vs last month

Churn rate

2.3%
Down 0.4 ptsvs last month

p95 latency

154 ms
Down 9.5%vs last month

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

$18,420
Up $2,100vs last month

Across 9 unpaid invoices

Collected

$64,905
Up 8.2%vs last month

Updated 4 minutes ago

Refunds

$1,260
No change, No changevs last month

3 refunds this month

API

StatGroup

PropTypeDefaultDescription
variant'separate' | 'shared''separate'Cards, or one surface with hairlines.
minItemWidthstring'13rem'Narrowest a stat gets before the grid wraps.

StatDelta

PropTypeDefaultDescription
valueReactNode—The formatted change, e.g. "12.4%".
direction'up' | 'down' | 'flat''up'Arrow direction.
tone'positive' | 'negative' | 'neutral'—Colour; defaults from direction.
comparisonReactNode—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.