noahgdev

Donut Chart

Dashboards 5

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
  • Funnel Chart

    Funnel Chart

    3
  • Heatmap Chart

    Heatmap Chart

    3
  • Sankey Chart

    Sankey Chart

    1
  • Segmented Meter

    Segmented Meter

    1
  • Revenue Ring Card

    Revenue Ring Card

  • Payment Summary Card

    Payment Summary Card

  • Commerce KPI Row

    Commerce KPI Row

  • Tick KPI Card

    Tick KPI Card

More in Dashboards

View all
  • Fernly — Project Management Dashboard with Kanban

    Fernly — Project Management Dashboard with Kanban

    751
  • Analytics Dashboard

    Analytics Dashboard

    81
  • Creator Dashboard

    Creator Dashboard

    216
  • Insights Dashboard

    Insights Dashboard

    44
  • Corbel — Sales Analytics Dashboard

    Corbel — Sales Analytics Dashboard

    446
  • serf dashboard

    serf dashboard

    144
  • Dashboard with Collapsible Sidebar

    Dashboard with Collapsible Sidebar

    2.7K
  • Halden — CRM Dashboard with Sales Pipeline

    Halden — CRM Dashboard with Sales Pipeline

    65