Search documentation

Search for a page or component.

Sparkline

A tiny inline area or line chart for showing a trend at a glance.

Area
Line
Dot grid
Custom color, step curve
import { Sparkline } from "@/components/ui/sparkline"

const data = [12, 18, 14, 22, 26, 21, 30, 34, 28, 40, 44, 52]

A tiny inline area or line chart with no axes, for showing a trend next to a number. It is what the KPI card and metric list use, and it is small enough to drop into a table cell.

Installation

pnpm dlx shadcn@latest add @dashboardcn/sparkline

Usage

import { Sparkline } from "@/components/ui/sparkline"

<Sparkline data={[12, 18, 14, 22, 26, 21, 30]} className="h-8 w-24" />