KpiTile
One number, its movement, and the baseline it moved against.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
One number, its movement, and the baseline it moved against.
Accessibility
Fully keyboard operable: Tab to focus, Enter/Space to activate. The visible focus ring uses --focus-ring — never remove it. Provide an accessible label (aria-label) for icon-only controls.
Install and import
npx shadcn@latest add @prism/kpi-tile
import { KpiTile } from '@/components/prism/KpiTile';
In a no-build prototype, read it from the bundle instead: const { KpiTile } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
label | React.ReactNode | Yes | What the number is. Wraps onto more lines rather than truncating. |
value | React.ReactNode | Yes | Pre-formatted — the caller owns currency, locale and precision. |
unit | React.ReactNode | — | |
delta | number | — | Signed percentage change. Requires comparison to mean anything. |
comparison | React.ReactNode | — | Names the baseline: "vs previous 30 days". Without it a delta is unreadable. |
goodDirection | "up" | "down" | — | Which direction is good. "down" for churn, refunds, latency, cost. |
sparkline | React.ReactNode | — | A TrendChart variant="spark" or similar. |
target | React.ReactNode | React.ReactNode[] | — | Target line(s): one node, or an array for several lines ("68% of £120k target", "Due 30 Sep"). |
icon | React.ReactNode | — | Icon beside the label (decorative; the label names the metric). |
tone | "notice" | "negative" | "positive" | — | Attention state: an edge bar plus a status glyph and screen-reader text, so it isn't colour alone. |
toneLabel | string | — | Screen-reader text for the tone. Defaults: "Needs action" / "Needs attention" / "On track". |
href | string | — | Make the whole tile a link (e.g. to the list behind the number), through LinkProvider. |
linkComponent | LinkComponent | — | Overrides LinkProvider's link component for this tile. |
valueFont | "body" | "display" | "mono" | — | The figure's face: "body" (default), "display" (match a serif or glyphic --font-display) or "mono". Theme-wide: set --figure-font. |
valueTitle | React.ReactNode | — | The exact figure behind a compact value ("₹9,99,93,000.00" for "₹9.99 Cr"): shown as a tooltip and read by screen readers after the value. |
formatDelta | (delta: number) => React.ReactNode | — | |
className | string | — |