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
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.
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