KPI board
The top of a dashboard: three to six KPIs, a chart for the one you pick, and its top rows.
What a block is
A block is a kit component for a whole area of a screen, built only from other kit components and tokens. You import it like any component; nothing is copied into your app. Put it inside your page’s <main>: it brings no header or nav of its own.
When to use
- the first row of an analytics or reporting dashboard
- compare a few KPIs and drill into one without leaving the page
- one range (7 / 30 / 90 days) should change cards, chart and table together
When not to use
- only a strip of numbers: Scoreboard
- one chart on its own: LineChart or BarChart
- a full dataset to search and filter: DataTable
- more than six KPIs: a Scoreboard (it wraps) and a separate chart
Usage
Three to six KPIs sit in a selectable Scoreboard, the only picker (five or six wrap; on a phone they go two by two): the chart and the table of top rows follow the one marked Charted. Deltas read Better or Worse. One range control changes all of them.
Layout
- top: heading beside the range SegmentedControl
- then the selectable Scoreboard of KPIs: appearance cards; below --grid-breakpoint-sm (40rem) of block width it turns divided and four go two by two; five or six wrap
- then the LineChart beside the DataTable, in layout-split--primary
- the block is its own inline-size container; below --grid-breakpoint-md (64rem) of block width the table stacks under the chart
Props
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
| metrics | array | Yes | — | 3–6 of { id, label, goodWhen?, values: Record<range, { value, delta?, trend?, deltaTone?, hint? }>, columns: DataTableColumn[], rowsTitle?, rankBy? }. Values are pre-formatted strings; a range with no entry shows a dash. goodWhen (up for MRR, down for overdue or churn) makes the delta read Better or Worse. hint is the muted text after the delta, e.g. "vs Oct"; default "last <range label>". |
| series | object | Yes | — | series[metricId][range]: ChartDatum[] ({ label, value }) for the LineChart. |
| rows | object | Yes | — | rows[metricId][range]: DataTableRow[] (each with id). Ranked by the metric's rankBy column, highest first, then cut to rowLimit. |
| ranges | array | Yes | — | { value, label }[], two to four, e.g. Month / Quarter / Year. Ranges are data, not an enum. |
| range | string | No | — | Controlled range value. |
| defaultRange | string | No | — | Uncontrolled starting range. Default the first. |
| onRangeChange | function | No | — | (range) => void |
| selectedMetric | string | No | — | Controlled metric id for the chart and table. |
| defaultSelectedMetric | string | No | — | Uncontrolled starting metric. Default the first. |
| onSelectedMetricChange | function | No | — | (metricId) => void |
| rowLimit | number | No | 5 | How many top rows the table shows. |
| description | string | No | — | Line under the heading. |
| title | string | No | Key metrics | — |
Built from
Related
- Component
Scoreboard
Metrics strip of kit Scorecards: two to six figures, and the only metric picker.
- Component
Line
Change and progress over ordered samples as a line or area chart.
- Component
Bar
Compare magnitudes across categories with vertical or horizontal bars.
- Component
DataTable
Framed dataset with search, filters, column settings, and a caption title.