Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-chart-donut.json --yes

Chart donut

Pro

A donut chart that shows how one whole splits into parts, each slice read on hover, on a press or from the keyboard, for React and Tailwind CSS. Part of Goop Pro.

Point at a slice or a legend row and it slides out, the hole reading it; click to pin, Escape to let go (the line under it says which is pinned); switch the slices, the caption, the hole’s value, a slice pinned at first, the legend beside, loading. The recordings are ours; the slice pinned is only written under it.

When to use

  • A donut chart that shows how one whole splits into parts, each slice read on hover, on a press or from the keyboard.
  • Also called: pie chart or ring chart.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Chart donut on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-chart-donut.json --yes
PROMPT
Add the Goop Chart donut to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { ChartDonutLegend, ChartDonutTooltipContent } from '@/components/ui/goop/chart-donut';

import { ChartDonut } from '@/components/ui/goop/chart-donut';

function InterviewsByLength() {
  return (
    <ChartDonut
      title="Interviews by length"
      description="Recorded this month"
      summary="Interviews recorded this month by length: half of the 46 ran 30 to 60 minutes."
      config={{ interviews: { label: 'Interviews' } }}
      categoryKey="length"
      unit="interviews"
      caption="Total"
      data={[
        { length: 'Under 30 min', interviews: 14 },
        { length: '30 to 60 min', interviews: 23 },
        { length: 'Over 60 min', interviews: 9 },
      ]}
    />
  );
}
  • Fits: overview: body.
  • height, width, padding, gap, corner, background, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
configNoInfer<ChartConfig<ChartKey<Data>>>The series, in order, each keyed by a field of the rows: its label, and dashed if wanted.
dataDataThe rows, a slice each: of the caller's own type (an interface too) or ChartRow.
categoryKeyNoInfer<ChartKey<Data>>The field of each row that holds its category.
caption?string = 'Total'The short words above the hole's value.
total?numberThe number in the hole; the shown slices' sum when left out.
otherLabel?string = 'Other'The name of the slice the rows past the fourth are folded into.
pinned?number | nullThe pinned slice, by its place from 0, or null: held by the page, with onPinnedChange.
defaultPinned?numberThe slice pinned when the chart mounts, by its place from 0.
onPinnedChange?(pinned: number | null) => voidCalled with the slice a press pins, or null when let go.
  • Takes every prop of ChartContainer but plot, children, legend, encode, markers and endLabels (its page: chart.md)
  • State: pinned (pinned / defaultPinned / onPinnedChange)
  • Types: Slice = { name: string; value: number; series: number; members?: string[] }
Parts
PartWhat it is
ChartDonutLegendThe donut's legend under the ring
ChartDonutTooltipContentThe tooltip's words for a held slice, in the theme's tooltip panel; payload?: ReadonlyArray<{ payload?: Partial<Slice> }> — The held slice's entry; className?: string — Classes for the panel, last
  • data-slot values (to select a part by): chart-donut, chart-donut-caption, chart-donut-inner, chart-donut-item, chart-donut-legend, chart-donut-legend-item, chart-donut-legend-members, chart-donut-readout, chart-donut-share, chart-donut-status, chart-donut-value

Keyboard

KeyWhat it does
TabFocus the plot, then the legend's row
ArrowLeftMove the held slice
ArrowRightMove the held slice
EscapeHide the tooltip and let a pinned slice go
ArrowDownMove to the next legend row, wrapping
ArrowUpMove to the previous legend row, wrapping
HomeMove to the first legend row
EndMove to the last legend row
EnterHide or show the legend row's slice
SpaceHide or show the legend row's slice

Accessibility

  • The native element answers the keyboard.
  • hover: the browser's own (:hover): write nothing

Motion

  • The part sets its own motion: add no transition or animation of your own.

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/meadow/components/chart-donut.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-chart-donut.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.