KPI card
Put one metric on a KPI card: a label, the big value, up to two comparison chips, an optional attainment and a small trend line with the last value.
- React
import { KpiChart } from 'boardplot/react/kpi';- Reference
- Data, options and sizing
- Use for
- Headline metric with trend · Metric against PY and plan · Dashboard tile
- Not for
- Several categories side by side; kpi shows one metric.
Forecast against prior year and plan
A KPI card shows a landing forecast of $10.6m, down 9% on the prior year and 11% below plan, with a bar at 89% of plan.
dual-compare
JSON spec
This spec includes the theme shown and the options you selected.
Changed from the fixture: data.format.
{
"type": "kpi",
"data": {
"label": "FY26 landing forecast",
"value": 10600000,
"format": "$1.1m",
"compare": [
{
"vs": 11650000,
"label": "YoY",
"mode": "both"
},
{
"vs": 11910000,
"label": "vs Plan",
"mode": "both"
}
],
"attainment": {
"vs": 11910000,
"label": "of Plan"
}
},
"options": {
"size": {
"width": 380
},
"title": "Landing remains below prior year and plan",
"source": "Illustrative commercial forecast, Jul close"
}
}Churn card where lower is better
A KPI card shows net revenue churn of 3.2%, down 0.9 points on the prior year, in green because lower is better, with a falling trend line.
churn-card
JSON spec
This spec includes the theme shown and the options you selected.
{
"type": "kpi",
"data": {
"label": "Net revenue churn",
"value": 3.2,
"format": "1.2%",
"delta": {
"vs": 4.1,
"scenario": "PY",
"direction": "lowerIsBetter",
"mode": "absolute"
},
"spark": {
"kind": "line",
"values": [
5.8,
5.1,
4.9,
4.4,
4.1,
3.8,
3.5,
3.2
]
}
},
"options": {
"title": "Churn fell to 3.2% in FY25, down 0.9 points vs PY",
"source": "Acme SaaS retention cohort model"
}
}Weekly orders with a trend line
A KPI card shows 110k weekly orders, up 15% on week 1, with a sparkline that marks the unreported week 4 as a dotted gap.
weekly-orders-card-spark
JSON spec
This spec includes the theme shown and the options you selected.
Changed from the fixture: options.title.
{
"type": "kpi",
"data": {
"label": "Weekly orders, W8 2026",
"value": 110000,
"format": "1k",
"compare": [
{
"vs": 96000,
"label": "vs W1",
"mode": "relative"
}
],
"spark": {
"kind": "line",
"values": [
96000,
98000,
101000,
null,
104000,
103000,
107000,
110000
],
"labels": [
"W1",
"W2",
"W3",
"W4",
"W5",
"W6",
"W7",
"W8"
]
}
},
"options": {
"title": "Weekly orders reach 110k, up 15% on the first week",
"source": "Illustrative order data; W4 was not reported"
}
}Subscriber count with year-over-year chip
Option shown: Own colors, the spark in ink.
A KPI card shows 48.2k active subscribers, up 7.3% year over year in a green chip, with a rising dark trend line.
spark-ink-pale-neutral
JSON spec
This spec includes the theme shown and the options you selected.
Changed from the fixture: options.theme.
{
"type": "kpi",
"data": {
"label": "Active subscribers",
"value": 48200,
"format": "1.2k",
"compare": [
{
"vs": 44900,
"label": "YoY",
"mode": "relative"
}
],
"spark": {
"kind": "line",
"values": [
41000,
42300,
43500,
44800,
45900,
46900,
48200
]
}
},
"options": {
"theme": {
"preset": "bridge",
"overrides": {
"color": {
"neutral": "#C9D2E0",
"neutralMark": "#0B1B3A",
"spark": "#0B1B3A"
}
}
},
"title": "Active subscribers are 7% up on the year",
"source": "Illustrative data"
}
}ARR card with area trend
A KPI card shows annual recurring revenue of $182.4m, up 10% on the prior year, with an area sparkline from January to June.
arr-card
JSON spec
This spec includes the theme shown and the options you selected.
Changed from the fixture: data.format.
{
"type": "kpi",
"data": {
"label": "ARR",
"value": 182400000,
"format": "$1.2m",
"delta": {
"vs": 165200000,
"scenario": "PY"
},
"spark": {
"kind": "area",
"values": [
121400000,
130200000,
138900000,
150700000,
165200000,
182400000
],
"labels": [
"Jan FY26",
"Feb FY26",
"Mar FY26",
"Apr FY26",
"May FY26",
"Jun FY26"
]
}
},
"options": {
"source": "Acme SaaS finance actuals, Jun FY26"
}
}Cash balance with month-end trend
A KPI card shows cash on hand of $4.8m today, with a trend line of month-end balances from April to June that ends at $4.6m.
spark-ends-below-card
JSON spec
This spec includes the theme shown and the options you selected.
Changed from the fixture: data.format.
{
"type": "kpi",
"data": {
"label": "Cash on hand",
"value": 4820000,
"format": "$1.2m",
"note": "Today; the trend shows month-end balances",
"spark": {
"kind": "line",
"values": [
4100000,
4350000,
4610000
],
"labels": [
"Apr",
"May",
"Jun"
]
}
},
"options": {
"source": "Illustrative treasury data"
}
}Minimal spec
Save this spec as kpi.json and run the command.
{
"type": "kpi",
"data": { "label": "Revenue", "value": 120, "delta": { "vs": 100, "scenario": "PY" } },
"options": { "unit": "$k", "title": "Revenue is $20k above prior year", "source": "Illustrative data" }
}npx boardplot render kpi.json --out kpi.svg