Stat With Sparkline

Metric card with a label, a large value, a signed delta and an edge-to-edge area sparkline that turns red when the trend is down. Built for React dashboards.

src/registry/ui/stat-sparkline.tsx/r/stat-sparkline.json

Installation#

bash
npx shadcn@latest add @minidev/stat-sparkline

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/stat-sparkline.json

Usage#

tsx
import { StatWithSparkline } from "@/components/ui/stat-sparkline"

export function Example() {
  return <StatWithSparkline />
}

API reference#

StatWithSparkline props
PropTypeDefault
labelstring"Monthly revenue"
valuestring"$128,400"
deltastring"+12.4%"
pointsnumber[]SAMPLE_POINTS
classNamestring-

Dependencies#

npm

React only

Built from

All dashboard components