Interactive example
Project reviewSynthetic scores in points
  • Current
  • Previous
Use arrow keys to select a data point. Home selects the first point and End selects the last. Escape closes the value tooltip.
Clarity
Current
82 points
Previous
68 points
View data table 5 rows
Project review
Data pointCurrentPrevious
Clarity82 points68 points
Speed71 points74 points
Focus88 points76 points
Coverage77 points64 points
Polish84 points72 points

Installation

terminal
bunx --bun shadcn@latest add https://apple-ui-eduardo.vercel.app/r/radar-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 { RadarChart } from "@eduardoul/apple-ui";

const data = [
  { label: "Clarity", current: 82, previous: 68 },
  { label: "Speed", current: 71, previous: 74 },
  { label: "Focus", current: 88, previous: 76 },
  { label: "Coverage", current: 77, previous: 64 },
  { label: "Polish", current: 84, previous: 72 },
];

export function Example() {
  return (
    <RadarChart
      title="Project review"
      description="Synthetic scores in points"
      data={data}
      series={[
        { key: "current", label: "Current" },
        { key: "previous", label: "Previous" },
      ]}
      valueFormatter={(value) => value + " points"}
    />
  );
}

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
seriesChartSeries[]required
labelKeystringlabel
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 radar charts for profile shape when every measure uses the same scale and direction.
  • Limit the number of profiles. Overlapping polygons become hard to trace quickly.
  • Provide at least three categories and a finite nonnegative value for every series in every category.
  • Pair the visual with the built in data table when readers need exact comparisons.
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.