About
An animated donut or pie chart that sweeps its slices into view, highlights the hovered slice, and swaps its center readout between the total and the active slice's value and share.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Donut Chart to your project and fits it to your theme.
Code
How Donut Chart is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import { DonutChart } from "@/components/ui/chart-donut";
export default function DonutChartDemo() {
return (
<div className="flex w-full items-center justify-center p-10">
<DonutChart
title="Revenue by channel"
data={[
{ label: "Direct", value: 4200 },
{ label: "Organic search", value: 3100 },
{ label: "Referral", value: 1800 },
{ label: "Social", value: 950 },
{ label: "Email", value: 600 },
]}
/>
</div>
);
}








