Weekly active users
Last 18 weeks
6,100
Installation
$ pnpm dlx shadcn@latest add @synccn/area-chartFirst time in this project? Connect synccn with one command.
Usage
import { AreaChart } from "@/components/ui/charts";<AreaChart data={series} />API reference
Generated from the component's TypeScript types, so it always matches the code.
AreaChart
Area chart with a crosshair tooltip. data: [{ label, value }]
PropTypeDescription
- datarequired
ChartDatum[]Points, in order.
- height
numberDefault
200Chart height in pixels.
- format
(value: number) => React.ReactNodeDefault
(v) => vFormats the tooltip value.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Helpers
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA roles: img, meter
- ARIA attributes: aria-label, aria-pressed, aria-valuemax, aria-valuemin, aria-valuenow
More data
Data TableSorting, search, column visibility, selection and paging.Bar ChartResponsive SVG bars with tooltips and an entrance.SparklineTiny trend line coloured by direction.HeatmapContribution-style calendar of daily counts.KanbanDrag cards between columns.Sortable ListDrag to reorder, with Alt+arrow keyboard support.