Stop Rebuilding UI

Stats Donut Pill Legend

A donut breakdown stats card for React and Next.js with a Recharts PieChart donut, a center total label, and a full-width row of rounded-full pill legend badges with colored dots, segment labels, and tabular values built with shadcn/ui and Tailwind CSS

Scroll to load preview

Break down a total into segments with this donut stats card with pill legend for React and Next.js. Features a ChartContainer-wrapped Recharts PieChart with innerRadius 60 outerRadius 95 donut ring, chart data colored via var(--chart-1) through var(--chart-5), a centered total label absolutely positioned inside the ring, ChartTooltipContent for segment hover, and a full-width row of rounded-full pill badges below with colored dots, segment names, and tabular values. Built with TypeScript, ChartContainer from shadcn/ui, Recharts PieChart, motion/react parent entrance, Lucide React icons, and Tailwind CSS. Perfect for traffic source breakdowns, payment method distributions, device type splits, and budget category allocations.

FAQ

Last updated on April 12, 2026

Was this page helpful?

Sign in to leave feedback.