Skip to main content

KpiTile

One number, its movement, and the baseline it moved against.

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

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

PropTypeRequiredDescription
labelReact.ReactNodeYesWhat the number is. Wraps onto more lines rather than truncating.
valueReact.ReactNodeYesPre-formatted — the caller owns currency, locale and precision.
unitReact.ReactNode—
deltanumber—Signed percentage change. Requires comparison to mean anything.
comparisonReact.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.
sparklineReact.ReactNode—A TrendChart variant="spark" or similar.
targetReact.ReactNode | React.ReactNode[]—Target line(s): one node, or an array for several lines ("68% of £120k target", "Due 30 Sep").
iconReact.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.
toneLabelstring—Screen-reader text for the tone. Defaults: "Needs action" / "Needs attention" / "On track".
hrefstring—Make the whole tile a link (e.g. to the list behind the number), through LinkProvider.
linkComponentLinkComponent—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.
valueTitleReact.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—
classNamestring—