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#
| Prop | Type | Default |
|---|---|---|
data | number[] | SAMPLE_DATA |
className | string | - |
label | string | "Area chart" |
grid | boolean | true |
smooth | boolean | true |
highlight | number | - |
tone | keyof typeof TONES | "accent" |
Examples#
Related charts components#
Bar ChartLightweight React bar chart with rounded bars, dashed gridlines and labels. Hovering a bar dims the rest and shows its value; the peak is highlighted first.Chart CardCard wrapper for charts with a title, optional description and a minimum height body. Pairs with the area, bar and donut charts in a React dashboard.Chart LegendWrapping chart legend with small color swatches and labels. Pass colors per series or fall back to accent, success, warning and danger theme tokens.Chart Tooltip CardTooltip card for charts showing a title and label and value rows with tabular numbers. Drop it into any chart library's custom tooltip slot.Donut ChartSingle value donut chart in SVG that fills an accent ring to a percentage of max and prints the percent in the middle. Labelled as an image for screen readers.Funnel StepsA conversion funnel drawn as labeled horizontal bars scaled to the largest step, with formatted counts per stage. Suited to signup and checkout analytics.
All chart components