Skip to content
Thrum

Radial bar chart

Up to five progress arcs nested in one another, each from zero to its share of a maximum, with a total in the middle. Use it for a few goals of the same kind: quota by region, storage by disk. Lengths on an arc are harder to compare than on a bar, so when the exact comparison matters, use the bullet chart or the bar chart.

Install

npx shadcn@latest add @thrum-pro/radial-bar-chart

This is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.

Data shape

Type
type RadialBarChartItem = {
  name: string;         // written at the ring's start
  value: number | null; // null = empty track
};
Sample
[
  { name: "North", value: 0.82 },
  { name: "South", value: 0.64 },
  { name: "East", value: null },
]

Props

PropTypeDefaultDescription
datareadonly RadialBarChartItem[]RequiredThe rings, outermost first. Up to five are drawn in the theme's chart colours; the rest are left out.
labelstringRequiredWhat the values measure. Shown under the total, read by screen readers and used as the table caption.
maxnumberDefault largest valueThe value of a full ring. A value past it draws a full ring and keeps its real number in the readout.
sweepnumberDefault 270How far a full ring goes round, in degrees, clockwise from 12 o'clock. Clamped to 90 to 360. Below 360 the names sit in the open quarter left of 12 o'clock.
totalnumber | null–The figure in the centre while no ring is under the cursor, with the label under it. Leave it out for an empty centre.
formatIntl.NumberFormatOptionsDefault compactHow values are written in the centre, the readout and the data table. Shares of the maximum are whole percentages.
localestringDefault "en-US"Locale for numbers. Fixed by default so the server and the browser print the same text.
onActiveChange(index: number | null) => void–Called with the index of the ring under the cursor, or null when the cursor leaves.
soundbooleanDefault truePlay a tick as the cursor moves between rings, if the visitor has sound on.
emptyLabelstringDefault "No data"Text shown when there are no rings.
classNamestring–Sets the size. The default is full width and 256 pixels tall; the rings fill the largest square that fits. Under 240 pixels wide the names move to a legend below the rings.

Motion and sound

Motion

  • First draw: each ring sweeps out clockwise from 12 o'clock in 250 ms, outermost first, 40 ms apart.
  • New data: every ring slides to its new length in 400 ms with no overshoot.
  • Ring ends are round when the project's corner radius is above zero and square when it is zero.
  • Reduced motion: the rings appear complete, and changes are instant.

Sound

  • A soft tick each time the cursor lands on a different ring, at most one every 40 ms.

Sound is off until the visitor turns it on. Pass sound={false} to keep this component silent. How sound works

Accessibility

  • The chart is one tab stop. It is exposed as a slider whose value text is the ring under the cursor, for example “North: 82% of 100%, 82%”.
  • A visually hidden table lists every ring with its value and its share of the maximum.
  • Colour is never the only key: each ring is named at its start, or in the legend on a narrow box, and the ring under the cursor shows its name, value and share in the centre.
  • Each ring's full width, gap included, is the pointer target; the empty track shows how far the ring could go.
KeysAction
TabFocus the chart. The cursor goes to the innermost ring.
← →Move the cursor one ring out or in.
Home / EndJump to the outermost or innermost ring.
EscHide the cursor and show the total again.

Source

SourcePro

The source comes with Pro

TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies

Files and dependencies

Adds
components/ui/radial-bar-chart.tsx
Packages
motion
Brings along
Chart foundationsMotion tokensSound engineChart tooltip

Changelog

  1. 1.0.0 · 2026-12-03First release.

Loading index…

Keyboard shortcuts

/Ctrl KSearch components, docs and actions
?Show this list
AAppearance studio
SSound on or off
MFull or reduced motion
TTheme: auto, light, dark
GSurface: solid or frosted
BBackdrop photograph (under glass)
CCorner radius: square to round
RReplay the demo, on a component page
DDraw new data, on a component page
←→HomeEndMove the cursor in a focused chart
EscClose a dialog, or leave a chart cursor