Skip to content

Radial Bar Chart for React

A React radial bar chart draws 2 to 5 measures as concentric rings against their goals, like activity rings. Pass data as readonly RadialBarItem[]: takes 2–5 measures, outermost ring first.

npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/radial-bar-chart.json

Quarterly goals

Use arrow keys to read each ring.
71%Overall

  • RadialBarChart
  • RadialBarTable
  • defaultRadialBarChartLabels
  • +1 more

Files to copy

11 folders · 25 files · 4 packages
From theme/src/
  • components/charts/{radial-bar-chart.tsx, chart-export-menu.tsx, chart-export.ts, chart-figure.tsx, chart-fit.tsx, chart-icons.tsx, chart-parts.tsx, chart-patterns.tsx, chart-utils.ts}
  • components/charts/chart-parts/
  • components/drawer/parts/sheet.tsx
  • components/kbd/
  • components/menu/
  • components/skeleton/
  • components/status-icons/
  • hooks/{use-controllable.ts, use-intersection.ts, use-latest.ts, use-media-query.ts, use-preferences.ts}
  • motion/tokens.ts
  • lib/{cn.ts, csv.ts, form.ts, glide-highlight.tsx, heading.ts, math.ts, popup-a11y.ts, popup-motion.ts, warn-once.ts}
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/radial-bar-chart.jsonRegistry item: radial-bar-chart. The styles need the Tailwind v4 glass UI setup.
Packages
pnpm add @base-ui/react clsx motion tailwind-merge

Next.js: samples here pass functions (formatters, seriesLegend, a dashboard's load), so put them in a file that starts with "use client".

Three-quarter arcs

The default. Each ring's name and value sit in the open quarter, right where the ring starts: no legend to cross-reference.

Quarterly goals

Share of target reached, Q3

71%Overall
  • New ARR82%
  • Expansion64%
  • Retention91%
  • Pipeline47%

Full rings with a legend

variant="ring" closes the rings (a 2px gap marks the seam) and lists the measures beside them. Each item can bring its own max; values past it fill the ring and still print in full.

Activity

Today

76%Daily goals
  • Steps8,240
  • Active minutes42
  • Calories380

Props

PropTypeDefaultDescription
data (required)readonly RadialBarItem[]NoneTakes 2–5 measures, outermost ring first.
maxnumber100Value of a full ring for items without their own max.
variant"ring" | "arc""arc""arc": three-quarter rings with their names in the open quarter (no legend needed). "ring": full rings, with a legend beside them.
display"value" | "percent""percent"What the ring labels and legend print: the share of the goal, or the value itself.
diameternumber260Largest diameter (px). The chart shrinks to fit narrower containers.
format((n: number) => string)formatCompactFormats values (tooltip centre, table).
formatPercent((n: number) => string)formatPercentDefault ("82%" / "\u221220%": a typographic minus, as formatCompact)Formats each share (a number from 0 to 100) for the labels and tooltip.
centerValueReactNodeNoneShown in the centre while no ring is active, e.g. an overall score.
centerLabelReactNodeNoneShows the caption in the middle under centerValue.
patternsbooleantrue when data.length > 3Tell rings apart without colour (hatch fills).
labelsPartial<RadialBarChartLabels>defaultRadialBarChartLabelsEvery other string, for translation: labels={{ instructions: "…" }}; omitted keys keep the English of defaultRadialBarChartLabels. All 7 keys of RadialBarChartLabels are listed in the key table under the props table.
aria-label (required)stringNoneAccessible summary of what the chart shows.
classNamestringNoneAdds extra classes to the outer element.
RadialBarChartLabels keys and English defaults (7)
Pass any key in labels; the rest keep the defaults of defaultRadialBarChartLabels.
KeyEnglish default
instructionsUse arrow keys to read each ring.
ofMax(value, max) => `${value} of ${max}`
metricMetric
valueValue
maxGoal
percentProgress
emptyNo data

RadialBarTable

PropTypeDefaultDescription
data (required)readonly RadialBarItem[]NoneTakes 2–5 measures, outermost ring first.
maxnumber100Value of a full ring for items without their own max.
format((n: number) => string)formatCompactFormats values (tooltip centre, table).
labelsPartial<RadialBarChartLabels>defaultRadialBarChartLabelsEvery other string, for translation: labels={{ instructions: "…" }}; omitted keys keep the English of defaultRadialBarChartLabels. All 7 keys of RadialBarChartLabels are listed in the key table under the props table.
formatPercent((n: number) => string)formatPercentDefault ("82%" / "\u221220%": a typographic minus, as formatCompact)Formats each share (a number from 0 to 100) for the labels and tooltip.
captionstringNoneVisually hidden caption naming the table for screen readers.

Keyboard

KeysAction
TabFocus the chart. It is one tab stop; the arrow keys then read it.
Arrow keysMove between measures.
Home/EndJump to the first / last measure.
EscapeClear the reading.

Accessibility

  • The figure takes focus as one stop and is named by its aria-label, the chart title. A one-line hint explains the keys, and a ChartCard table view is linked through aria-details. Values are announced politely, once per move. Each move announces the measure, its value and its share.
  • For a non-visual reading, give ChartCard's table prop a RadialBarTable; the Chart / Table tabs then expose each value as plain table cells.
  • With reduced motion on, the rings start at their final lengths and a data change jumps straight to the new state.

All exports on this page

  • RadialBarChart — Concentric arcs or rings, one per measure, each filled to its share of a maximum.
  • RadialBarTable — The chart's table view: every measure with its value, goal and share.
  • defaultRadialBarChartLabels — The built-in English strings of RadialBarChart; spread it into your own labels and change what you need.

When to use the radial bar chart

  • Use it as progress rings for quarterly goals, where two to five measures each show progress against a target as concentric rings with the share printed right where each ring starts.
  • It fits an activity-ring style summary, such as move, exercise and stand today versus yesterday, with variant ring closing the rings and a legend beside them.
  • It works when items have different targets, since each datum can bring its own max and values past it still fill the ring and print in full.
  • Skip it when there is only one measure or you need a single value on a dial; use GaugeChart or RadialProgress, and use BarChart for more than five items or exact comparison.
  • Pair it with ChartCard for the title, RadialBarTable for the Chart / Table tabs, and centerValue and centerLabel to show an overall figure while no ring is active.

Frequently asked questions

48 charts pages in all: browse them on Charts.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .