Sparkline Set

Responsive grid of metric cards, each with a label, value, delta chip and a small area chart sparkline. Good for a KPI overview at the top of a React dashboard.

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

Installation#

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

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/sparkline-set.json

Usage#

tsx
import { SparklineSet } from "@/components/ui/sparkline-set"

export function Example() {
  return (
    <SparklineSet items={[
      { label: "Revenue", value: "$48.2k", delta: 12.4, data: [12,18,15,28,22,36,30,42] },
      { label: "Signups", value: "1,204", delta: 4.1, data: [8,10,9,14,13,18,16,20] },
      { label: "Churn", value: "2.1%", delta: -0.4, data: [6,5,7,4,5,3,4,3] },
    ]} />
  )
}

API reference#

SparklineSet props
PropTypeDefault
itemsSparklineItem[]SAMPLE_ITEMS
classNamestring-

Dependencies#

npm

React only

Examples#

All dashboard components

Learn more