lailai0916

Donut

Dashboards

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>
  );
}

Dependencies

More by lailai0916

View all
  • Window Panel

    Window Panel

    8
  • Dialog

    Dialog

    1
  • Window Bar

    Window Bar

  • Tabs

    Tabs

  • Scrollable Data Table

    Scrollable Data Table

  • Skip Link

    Skip Link

  • Site Header

    Site Header

  • Skeleton

    Skeleton

More in Dashboards

View all
  • Dashboard with Collapsible Sidebar

    Dashboard with Collapsible Sidebar

    2.5K
  • Sidebar

    Sidebar

    286
  • SaaS Template

    SaaS Template

    2.5K
  • Course Design Cards

    Course Design Cards

    1.1K
  • Chat template

    Chat template

    614
  • System Status Block

    System Status Block

    316
  • Statistics Card 7

    Statistics Card 7

    301
  • Bar Chart

    Bar Chart

    1