Area Chart

Dependency free SVG area chart for React with a smoothed line, dashed grid, gradient fill and an optional highlighted point. Strokes stay crisp at any size.

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

Installation#

bash
npx shadcn@latest add @minidev/area-chart

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/area-chart.json

Usage#

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

export function Example() {
  return (
    <AreaChart data={[12,18,15,28,22,36,30,42]} />
  )
}

API reference#

AreaChart props
PropTypeDefault
datanumber[]SAMPLE_DATA
classNamestring-
labelstring"Area chart"
gridbooleantrue
smoothbooleantrue
highlightnumber-
tonekeyof typeof TONES"accent"

Examples#

All chart components

Learn more