Interactive Area Chart

A React SVG area chart with a crosshair that follows the pointer or arrow keys, showing the value and percent change against a dashed comparison line.

src/registry/ui/interactive-area-chart.tsx/r/interactive-area-chart.json

Revenue · Dec

$84k

+35.5% vs last year
RevenueLast year
JanFebMarAprMayJunJulAugSepOctNovDec

Hover or use arrow keys

Installation#

bash
npx shadcn@latest add https://ui.minidev.pro/r/interactive-area-chart.json

Usage#

tsx
import { InteractiveAreaChart } from "@/components/ui/interactive-area-chart"

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

API reference#

InteractiveAreaChart props
PropTypeDefault
dataPoint[]SAMPLE
format(n: number) => string(n: number) => `$${n.toLocaleString()}k`
labelstring"Revenue"
compareLabelstring"Last year"
classNamestring-

Dependencies#

npm

React only

Built from

Examples#

All chart components