Skip to main content

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 bar
Live demo
Open ↗

When 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​

PropTypeRequiredDescription
eyebrowReact.ReactNode—Small category label above the number.
valueReact.ReactNode—The metric itself, e.g. "€248,120" or "1,284".
unitReact.ReactNode—
deltaReact.ReactNode—Delta label, e.g. "12.4%".
deltaDirection"up" | "down" | "flat"—
iconReact.ReactNode—Optional leading icon (shown top-right instead of delta).
sparklineDatanumber[]—Numbers for the built-in sparkline.
sparklineReact.ReactNode—Or supply a custom chart node.
actionsReact.ReactNode—
classNamestring—