KPI
A headline number that always states its comparison: a delta, a sparkline, progress toward a target or a two-bar comparison.
Example
// Linked: aggregated over the rows the nearest Selection lets through
<KPI
label="Net revenue"
data={orders}
value="amount"
compareValue="previous_amount"
trendBy="date"
format="currency-compact"
comparison="vs. previous period"
/>
<KPI
label="Revenue vs. target"
data={orders}
value="amount"
format="currency-compact"
target={{ value: 450_000, label: 'Q3 target', expected: 0.93 }}
/>
// Static: plain numbers, no data
<KPI label="Conversion rate" format="percent" unit="RATE" compare={{ current: 0.0312, previous: 0.0314 }} />Usage
A KPI is static when value is a number, or linked when you pass data and a field: it aggregates the field (sum by default) over the rows the nearest <Selection> lets through. compareValue computes the delta; trendBy draws a sparkline per distinct value; target shows progress and reads “on pace”, “ahead of” or “behind pace” against expected.
Percent-formatted values show their delta in points. deltaDigits chooses 0–20 fractional places for the change pill separately from the value format. Read Formatting and notation for precision and locale choices. KPIGroup lays out up to four KPIs that share data, as cards or as one strip.
Props
KPI
data to aggregate (linked mode). With aggregate="count" the field may be omitted.value is combined across rows. Defaults to sum.value aggregated per distinct value of this field, in order.compareValue or compare when omitted.trendBy).true in linked mode to use the aggregated value and compareValue.KPIGroup
data.KPITarget
KPICompare
Accessibility
- Each KPI is a
groupnamed by its label, so the value, delta and comparison are read together. - While loading it reports
aria-busyand keeps its size.