Component libraryDonut chart

Donut chart

Pro

Show composition with exact controlled inspection, legend visibility and a native table fallback.

npx shadcn@latest add @tidal-pro/donut-chart
Desktop viewport

Installation

Pro source is gated. Configure the @tidal-pro registry using the agent guide. Create an access key from your account after purchasing.

Terminal
npx shadcn@latest add @tidal-pro/donut-chart

Import components/ui/tidal.css, components/ui/donut-chart.css, then add the component inside a tidal-scope wrapper. Its scoped design tokens keep it independent of your existing CSS.

Usage

Complete example source · Dependency and asset manifest

Loading the complete example…

API & behavior

Required title, consumer-owned segments{id,label,value,displayValue,description?}, and exact totalText. Finite positive visible values produce exact proportional arc geometry with only a bounded sub-degree visual gap; zero, negative and nonfinite values stay out of the chart while remaining explicit in the HTML table. Geometry scales before summing so multiple Number.MAX_VALUE values remain finite. Optional controlled activeId/onActiveChange enables a labelled SVG radiogroup with plain Arrow/Home/End inspection and Enter/Space activation. Optional controlled hiddenIds/onHiddenChange turns legend rows into native toggle buttons and leaves the legend available when every arc is hidden. Optional description, center, h2-h4 headingLevel, chartLabel, legendLabel, tableLabel, emptyMessage, per-segment SVG refs, legend button refs/getLegendButtonProps, and native figure attributes/ref. Legend native onClick runs first and preventDefault suppresses the higher callback; disabled and aria-disabled true normalize while explicit false is preserved. Focus recovers only when the actually focused arc is removed. The table region enters the tab order only when it overflows. The component does no requests, aggregation, persistence or analytics.

Style with the --t-* CSS variables. Set data-theme="dark" on your tidal-scope wrapper for a dark surface. Motion respects the system’s reduced-motion preference.

Building with an agent?Give it the installation guide and component catalog.