Skip to content

KPI

GraphKpi

One large number with a sparkline under it.

Good when one number is the headline and the rest is context. Several numbers with no trend is Stat.

Command

pnpm dlx shadcn@latest add <origin>/r/graph-kpi.json

Reads

The number is the headline. The spark is the last twelve points.

[ READS ]

12,400

this week

+18%

12,400 this week. +18%

Latency

A latency number with a falling series.

[ P95 ]

142ms

read

−18ms

142ms read. −18ms

Props

PropTypeDefaultDescription
titlestringCaption drawn on the top edge of the frame.
valuestringThe large number, already formatted.
labelstringLine under the number.
hintstringOptional extra next to the label, like a delta.
datanumber[]Sparkline values. Scaled to the highest point.
glyphs"shade" | "ascii" | "hash" | "bar" | string[]Sparkline characters. Defaults to ▁▂▃▄▅▆▇█.
palette"mono" | "duo" | "multi""mono"mono is one accent plus muted. duo paints the second series with --graph-accent-2. multi cycles three accents.
cornerstring"+"Character at each corner of the frame.
classNamestringPassed to the outer frame.