chartcn

Metric sparkline

KPI cards with compact sparkline trends.

Daily active users
12.4k+6.2%
New accounts this week
842+12.1%
Net bookings
$48.2k+3.4%

Data shape

type MetricCard = {
  key: string
  title: string
  value: string // formatted KPI
  delta: string // e.g. "+6.2%"
  description: string
  color: string // chart token
  data: Array<{ i: number; v: number }> // sparkline points
}

Primary number + delta live outside the chart; the sparkline is a small LineChart over recent points.

On this page