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

    6
  • 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.4K
  • Sidebar

    Sidebar

    235
  • SaaS Template

    SaaS Template

    2.4K
  • Stats Bento

    Stats Bento

    1.1K
  • Financial Bento Grid

    Financial Bento Grid

    71
  • Stats cards with links

    Stats cards with links

    33
  • Course Design Cards

    Course Design Cards

    1.1K
  • Chat template

    Chat template

    598