Skip to content

Data display

Stat

Stat is the KPI tile for dashboards: a label, one big number, the change since the last period and an optional sparkline and footnote. The change is always written out with an arrow and a sign, and you decide whether a rise is good or bad, so a drop in churn or latency can read as good news.

On this page

Monthly revenue

$48,210

Up 12.4% (positive)vs Sep

Active customers

1,284

Up 3.1% (positive)vs Sep

Churn rate

1.8%

Down 0.4 pts (positive)vs Sep

Avg. response time

212 ms

Up 18 ms (negative)vs Sep

Usage

components/ui/stat.tsx
import { Stat, StatGroup } from "@/components/ui/stat"; <Stat  label="Monthly revenue"  value="$48,210"  delta={{ value: "12.4%", direction: "up", label: "vs Sep" }}  spark={[29, 31, 30, 34, 36, 35, 38, 40, 39, 42, 43, 48]}/>

Examples

Overview

Monthly revenue

$48,210

Up 12.4% (positive)vs Sep

Active customers

1,284

Up 3.1% (positive)vs Sep

Churn rate

1.8%

Down 0.4 pts (positive)vs Sep

Avg. response time

212 ms

Up 18 ms (negative)vs Sep

With icon and footnote

A footnote says where the number comes from or what period it covers. The delta is optional.

Available balance

$128,940.12

Updated 4 minutes ago from 3 accounts

Outstanding invoices

$21,496

Down $3,210 (positive)since last week

12 invoices, 3 overdue

Direction and intent

direction is what the number did; intent is whether that is good. Up defaults to good and down to bad; override it for metrics where lower is better. The arrow and sign carry the direction, color only adds emphasis.

Up 12.4% (positive)Revenue, higher is betterDown 6.2% (negative)Revenue, a drop is badDown 38 ms (positive)Latency, lower is betterUp 0.9% (negative)Error rate, a rise is badUnchanged 0%No change

Card grid

On their own, stats render as cards and reflow from one to three columns. Hover the sparkline to read each day.

Seats

9 / 10

Team plan

Uptime, 30 days

99.98%

Up 0.01 pts (positive)vs prior

Signups this week

342

Up 8% (positive)

Props

Stat

  • labelrequiredstringdefault: —What the number measures.
  • valuerequiredReactNodedefault: —Pre-formatted value: "$48,210", "99.98%".
  • deltaStatDeltadefault: —Change since the comparison period (see below).
  • iconReactNodedefault: —Small icon before the label.
  • sparknumber[]default: —Trend values for the sparkline.
  • sparkLabelsstring[]default: —One label per value; turns on the sparkline tooltip.
  • sparkColor1 | 2 | 3 | 4default: 1Chart series color.
  • format"number" | "compact" | "percent" | "ms" | "usd"default: —Format of values in the sparkline tooltip.
  • footnoteReactNodedefault: —Source, period or definition.
  • variant"card" | "plain"default: "card"plain drops the frame, for StatGroup or a Card.

StatDelta

  • valuerequiredstringdefault: —Change without a sign: "12.4%", "$3,210".
  • directionrequired"up" | "down" | "flat"default: —What the number did.
  • intent"good" | "bad" | "neutral"default: up good, down badWhether the change is good news.
  • labelstringdefault: —Comparison: "vs last month".

StatGroup

  • columns2 | 3 | 4default: 4Columns on large screens; one column on phones, two from small screens up.

Accessibility

  • The change is spoken as words ("Up 12.4% (positive)"), and shown with an arrow and a sign, so it never relies on green and red.
  • Text stays in text colors; only the small delta chip is tinted.
  • The sparkline is decorative: the value and delta carry the meaning. Hover shows a tooltip for sighted mouse users.
  • Use a full label ("Avg. response time", not "RT") and put the unit in the value.

Suggested