Kpi

KPI card showing a primary metric with optional delta indicator, icon, and sparkline.

Category: chart · WCAG 2.1-AA · chart, kpi, metric, dashboard, data-viz

Props

PropTypeDefaultDescription
valuestring | numberPrimary metric value
labelstringMetric label — rendered visibly at the top of the tile.
deltanumberChange value (positive = up, negative = down)
deltaFormat'number' | 'percent' | ((delta: number) => string)numberHow to render `delta`. `'percent'` treats it as percentage points and appends `%` (25.6 → +25.6%) — it does not multiply by 100. A function owns the whole string, sign included.
goodDirection'up' | 'down' | 'neutral'upWhich direction is *good* for this metric — the colour, independent of the arrow (which follows the sign of `delta`). 'up' (default) suits revenue; use 'down' for errors, latency, cost or churn, where a rise is bad news; 'neutral' keeps the arrow and drops the sentiment colour.
deltaLabelstringDelta context label (e.g. "vs last week")
iconReactNodeIcon element rendered in the component.
sparklinenumber[]Trend data for embedded sparkline
classNamestringAdditional CSS class names merged onto the root element.

Design tokens

When to use

When not to use

Examples

Basic KPI card

import { Kpi } from '@cascivo/charts'

<Kpi value="$12,400" label="Monthly revenue" delta={8.2} deltaLabel="vs last month" />

Related components

← Back to docs