Installation
Theme
Mode

Data viz

KPI cluster

The row of stat tiles that crowns a dashboard. Each tile pairs a headline number and a tone-aware delta with an embedded micro-viz — a sparkline for a trend, a gauge for a rate against a ceiling.

$npx shadcn@latest add @orbit/kpi-cluster

Overview

Sprint 24 at a glance — four tiles, four micro-viz shapes.

Sprint 24 · overview
Velocity
41pts
+18%
Cycle time
2.4d
11%
Capacity used
88%
+6%
On-time delivery
92%
+3%

Micro-viz types

Set viz on each tile. Area and line trace a series over time, bars suit discrete periods, and a gauge frames a value against its 0–100 ceiling. A lone tile is just a KPITile.

viz="area"
Velocity
41pts
+18%
viz="line"
Cycle time
2.4d
11%
viz="bar"
Merged PRs
63
+9%
viz="gauge"
Capacity used
88%
+6%

Tone-aware delta

Direction and meaning are separate. The arrow follows the number's movement; the color follows whether that movement is good. A falling cycle-time is green and points down — so set tone by impact, not by sign.

Velocity
41pts
+18%
Cycle time
2.4d
11%
Open bugs
17
+5%
WIP limit
6/8
0%
tone="pos"good change
tone="neg"bad change
tone="warn"watch it
tone="neutral"flat / info

Layout

One columns prop drives an equal-width grid. Tiles never shrink their numbers — give six tiles room, or stack to two on a narrow panel.

columns="3"
Active projects
12
+2
On-time delivery
92%
+3%
Avg review time
4.1h
14%
columns="6"
Velocity
41
+18%
Cycle
2.4d
11%
Merged
63
+9%
Bugs
17
+5%
Capacity
88%
+6%
On-time
92%
+3%

Props

KPICluster lays out the grid; each entry in data (or a standalone KPITile) takes the tile fields.

PropTypeDefaultDescription
dataKPITileData[]The tiles, most important metric first. KPICluster only.
columnsnumberdata.lengthEqual-width grid columns (1–6). KPICluster only.
labelstringMetric name shown above the value.
valuestringHeadline value, preformatted — it is never scaled down.
unitstringUnit rendered after the value (“pts”, “%”, “d”).
deltastringDelta text (“+18%”, “−11%”) — a leading minus draws a down arrow.
tone"pos" | "neg" | "warn" | "neutral""neutral"Impact of the change — colors the pill with success / danger / warning / neutral tokens.
dir"up" | "down"Arrow direction override, when sign and direction disagree.
viz"area" | "line" | "bar" | "gauge""area"Micro-viz shape for the tile.
accentstring"var(--pri)"Viz color (any token or color-mix).
seriesnumber[]Series for area | line | bar.
gaugenumber0–100 value for the gauge arc. Falls back to parsing value.
…restHTMLAttributesForwarded to the root (div for KPICluster, figure for KPITile), including ref and className.

Usage

A KPI cluster is a glance, not a report — three to six tiles of the metrics that decide the day, nothing more.

Do

Limit to the vital few

Three to six tiles. Past that the row stops being a glance and becomes a table.

Don’t

Mix unrelated time frames

If one tile is “this sprint” and another is “all-time”, the row reads as inconsistent. Align the window.

Do

Set tone by impact

Fewer bugs is good even though the arrow may point either way — color by what it means, not its sign.

Don’t

Use a gauge for an open metric

Gauges imply a 0–100 ceiling. For an unbounded count like velocity, use a sparkline instead.

Keyboard & accessibility

The cluster is a group of labelled figures; every delta is spelled out as arrow plus text.

rolegroup, each tile a labelled figure
aria-label“Velocity 41 pts, up 18%”
ColorDelta sign also shown as arrow + text
OrderMost important metric reads first