Xzero UI
Pro library

Radar chartPro

Two or three profiles on one web: shapes morph when you swap a profile, and a sweep across the axes compares values in place.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/radar-chart
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/radar-chart

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { RadarChart } from "@/components/xzero/radar-chart/radar-chart";

const axes = [
  { key: "talent", label: "Talent pool" },
  { key: "afford", label: "Affordability" },
  { key: "transit", label: "Transit" },
  { key: "life", label: "Quality of life" },
  { key: "tax", label: "Tax climate" },
];

export function Offices({ rival }: { rival: RadarSeries }) {
  return <RadarChart axes={axes} series={[lisbon, rival]} label="Office locations" />;
}

API reference

RadarChart

Two or three profiles on one web of five to eight measures. Profiles are drawn by position, so replacing one morphs its shape into the next. Moving across the web picks the nearest axis and compares every profile's value there.

PropTypeDefaultDescription
axes (required)RadarAxis[]–Measures around the web, clockwise from the top: { key, label, max? }. At least three.
series (required)RadarSeries[]–Up to three profiles: { key, label, values }. They take the series hues in order, the first derived from the accent; replacing the series at a position morphs that shape.
label (required)string–What is compared. Names the chart, the summary, and the table.
maxnumber100Default top of every axis.
ringsnumber4Concentric guides.
sizenumber320Largest web diameter in pixels. It shrinks to fit narrow containers.
formatValue(value: number, axis: RadarAxis) => string–Formats values in the tooltip and table.
activeAxisstring | null–Controlled axis in focus.
onActiveAxisChange(key: string | null) => void–Called as the axis in focus changes.
legendbooleantrueProfile names with a line key. Hovering or pressing one brings its shape forward.
emptyLabelstring"No data"Message with fewer than three axes or no series.
refRef<HTMLElement>–Forwarded to the figure.
classNamestring–Extra class on the figure.

Keyboard interactions

KeysAction
TabFocuses the web and reads the first axis, then the legend.
ArrowRight / ArrowDownNext axis, clockwise.
ArrowLeft / ArrowUpPrevious axis.
Home / EndFirst or last axis.
EscapeClears the reading.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in advanced charts

Guidance for AI tools

Radar chart: Two or three profiles on one web: shapes morph when you swap a profile, and a sweep across the axes compares values in place. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components