MetricCard
A KPI card: eyebrow, large metric, delta pill and sparkline. @startingPoint section="Cards" subtitle="KPI metric card with delta & sparkline" viewport="360x200"
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
A KPI card: eyebrow, large metric, delta pill and sparkline.
Accessibility
When the whole card is actionable, expose a single accessible name and make it reachable with Tab + Enter. Decorative imagery uses empty alt.
Install and import
npx shadcn@latest add @prism/metric-card
import { MetricCard } from '@/components/prism/MetricCard';
In a no-build prototype, read it from the bundle instead: const { MetricCard } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
eyebrow | React.ReactNode | — | Small category label above the number. |
value | React.ReactNode | — | The metric itself, e.g. "€248,120" or "1,284". |
unit | React.ReactNode | — | |
delta | React.ReactNode | — | Delta label, e.g. "12.4%". |
deltaDirection | "up" | "down" | "flat" | — | |
icon | React.ReactNode | — | Optional leading icon (shown top-right instead of delta). |
sparklineData | number[] | — | Numbers for the built-in sparkline. |
sparkline | React.ReactNode | — | Or supply a custom chart node. |
actions | React.ReactNode | — | |
className | string | — |