Bklit UI
Area Chart
A composable React chart with gradient fills, axes, tooltips and hover interactions.
Revenue$18,420Sample data
| Date | Revenue | Costs |
|---|---|---|
| Jan 1 | 12000 | 8500 |
| Jan 2 | 13500 | 9200 |
| Jan 3 | 12800 | 8900 |
| Jan 4 | 16200 | 10100 |
| Jan 5 | 15100 | 9800 |
| Jan 6 | 17600 | 11200 |
| Jan 7 | 18420 | 11900 |
Install
npx shadcn@latest add @bklit/area-chartRequires a React project with shadcn/ui configured.
Use
import {
Area,
AreaChart,
ChartTooltip,
Grid,
XAxis,
} from "@/components/ui/area-chart";
const data = [
{ date: new Date("2025-01-01"), revenue: 12000, costs: 8500 },
{ date: new Date("2025-01-02"), revenue: 13500, costs: 9200 },
{ date: new Date("2025-01-03"), revenue: 12800, costs: 8900 },
];
export default function RevenueChart() {
return (
<AreaChart data={data}>
<Grid horizontal />
<Area dataKey="revenue" fill="var(--chart-line-primary)" />
<Area dataKey="costs" fill="var(--chart-line-secondary)" />
<XAxis />
<ChartTooltip />
</AreaChart>
);
}License checkedChart source is MIT licensed. Keep the included copyright and license notice.