noahgdev

Donut Chart

Dashboards

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

Dependencies

More by noahgdev

View all
  • Metric List

    Metric List

  • Sankey Chart

    Sankey Chart

  • Scatter Chart

    Scatter Chart

  • Radar Chart

    Radar Chart

  • Composed Chart

    Composed Chart

  • Bar Chart

    Bar Chart

  • Funnel Chart

    Funnel Chart

  • Activity Heatmap

    Activity Heatmap

More in Dashboards

View all
  • Fernly — Project Management Dashboard with Kanban

    Fernly — Project Management Dashboard with Kanban

    659
  • Analytics Dashboard

    Analytics Dashboard

    59
  • Creator Dashboard

    Creator Dashboard

    208
  • Insights Dashboard

    Insights Dashboard

    35
  • serf dashboard

    serf dashboard

    137
  • Corbel — Sales Analytics Dashboard

    Corbel — Sales Analytics Dashboard

    293
  • Dashboard with Collapsible Sidebar

    Dashboard with Collapsible Sidebar

    2.7K
  • Business/Sales Dashboard

    Business/Sales Dashboard

    1.5K