Stop Rebuilding UI

Shadcn.io is not affiliated with official shadcn/ui

React Donut Chart with Center Text

Donut chart with total value displayed in the center

Put that empty center to work. This React donut chart displays the total value right in the middle of the ring, giving users both the breakdown AND the sum at a glance. The Label component with a custom content renderer positions text at the chart's center using viewBox coordinates. Built with Recharts and shadcn/ui, the total updates dynamically with your data using useMemo. Perfect for Next.js budget dashboards, portfolio overviews, or any visualization where knowing "how much total?" is as important as "what's the breakdown?"

React Donut Chart with Center Text preview

Scroll to load preview

Installation

FAQ

Was this page helpful?

Sign in to leave feedback.