About
A donut, pie, or half-donut chart for shadcn/ui with a center label, tooltip, and legend, built on shadcn's chart primitives. The half-donut form doubles as a simple gauge.
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/dashboardcn-donut-chart"
const browsers = [
{ name: "Chrome", value: 58_400 },
{ name: "Safari", value: 21_300 },
{ name: "Firefox", value: 8_900 },
{ name: "Edge", value: 6_100 },
{ name: "Other", value: 2_400 },
]
export default function DonutChartDemo() {
return (
<div className="w-full max-w-xs">
<DonutChart
data={browsers}
centerLabel="Visitors"
showLegend
className="max-h-72"
/>
</div>
)
}
















