Interactive example
Milestone progressSynthetic progress percentages
  • Research
  • Design
  • Build
Scale 0 to 100%
Use arrow keys to select a data point. Home selects the first point and End selects the last. Escape closes the value tooltip.
Research
Value
74%
View data table 3 rows
Milestone progress
Data pointValue
Research74%
Design58%
Build86%

Installation

terminal
bunx --bun shadcn@latest add https://apple-ui-eduardo.vercel.app/r/radial-chart.json

The registry includes the shared styles and dependencies. Import @/components/apple-ui/styles.css in your root layout once. For the package route, use the installation guide.

Usage

tsx
"use client";

import { RadialChart } from "@eduardoul/apple-ui";

const data = [
  { label: "Research", value: 74 },
  { label: "Design", value: 58 },
  { label: "Build", value: 86 },
];

export function Example() {
  return (
    <RadialChart
      title="Milestone progress"
      description="Synthetic progress percentages"
      data={data}
      max={100}
      valueFormatter={(value) => value + "%"}
    />
  );
}

Package imports use @eduardoul/apple-ui. Registry imports use @/components/apple-ui. Add "use client" to files that use state or event handlers.

API reference

PropertyTypeDefault
dataChartDatum[]required
valueKeystringvalue
labelKeystringlabel
maxnumberlargest value
titlestringrequired
descriptionstringundefined
heightnumbercomponent default
loadingbooleanfalse
errorstringundefined
emptyMessagestringNo data to display.
showTablebooleantrue
compactbooleanfalse
valueFormatter(value: number) => stringlocalized number
classNamestringundefined
styleReact.CSSPropertiesundefined

Use className and style to customize the component. The package includes full TypeScript definitions for its supported element properties and refs.

Design guidance

  • Use comparison arcs for a few progress measures that share one target.
  • Set max to a known goal so the arc communicates the same scale across updates.
  • Values can be zero. The shared maximum must be positive and at least as large as every value.
  • Use a bar chart when readers need to compare many items or small differences.
Read Apple’s guidance

Accessibility

Give the chart a descriptive title and explain its units. Select a data point to read its values, or open the data table for the full dataset. Labels and values accompany color, and the chart adapts to reduced motion and appearance preferences. Test long labels, touch input and keyboard navigation with your own data.

Library styles support reduced motion, reduced transparency, increased contrast and forced colors. Read the accessibility foundation for the checks your application still needs.