About
A donut/ring chart card that shows proportional categories with a legend, hover highlighting, loading skeleton, and empty/error states.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Donut to your project and fits it to your theme.
Code
How Donut is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import Donut from "@/components/ui/donut";
export default function DonutDemo() {
return (
<div className="w-full max-w-sm">
<Donut
title="Donut"
icon="lucide:chart-pie"
items={[
{ x: "React", y: 60 },
{ x: "CSS", y: 30 },
{ x: "HTML", y: 8 },
{ x: "Other", y: 2 },
]}
maxSlices={3}
emptyText="No data yet"
/>
</div>
);
}
















