Radar Chart

Two or three series across five to eight measures, filled or outline, on a polygon or circle grid.

PROGet Radar Chart and 168 other Pro components with pro lifetime — Get Pro

Category
Data & feedback
Access
Pro
Source
105 lines · one file
States
6 drawn

The decision inside it

Every axis shares one scale

A radar whose axes use different scales draws a shape that means nothing, so the scale starts at zero and ends at one max for all of them.

When to use it

Use Radar Chart to compare two or three things across the same five to eight measures on one scale. For more series use grouped bars instead.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Liro's Radar Chart for this.
Install it: npx shadcn@latest add @liro/radar-chart
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/radar-chart.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.

Usage

components/ratings-radar.tsx
import { RadarChart } from "@/components/ui/radar-chart";

const data = [
  { measure: "Speed", us: 88, market: 64 },
  { measure: "Mobile", us: 92, market: 70 },
  { measure: "Templates", us: 74, market: 78 },
  { measure: "Price", us: 70, market: 58 },
  { measure: "Audit trail", us: 95, market: 66 },
];

export function Ratings() {
  return (
    <RadarChart
      data={data}
      axisKey="measure"
      max={100}
      description="Our ratings against the market average"
      series={[
        { key: "us", label: "Us" },
        { key: "market", label: "Market average", slot: 3 },
      ]}
    />
  );
}

API reference

“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

TypeNotes
dataT[] Yes–
axisKeykeyof T & string YesThe key that names each axis ("Speed", "Price").
seriesSeries[] Yes–
variant"filled" | "outline" NoDefault "filled".
grid"polygon" | "circle" NoDefault "polygon".
maxnumber NoTop of the shared scale. Default: the largest value.
format(v: number) => string No–
heightnumber No–
descriptionstring YesAccessible summary, read before the data table.
loadingboolean No–
errorReact.ReactNode No–
onRetry() => void No–
classNamestring No–

Dependencies

npm packages

clsxrechartstailwind-merge

Liro foundations, installed alongside it

liro-themechart

States

All of them are drawn by the component. None is left for you to design.

  • Filled
  • Outline
  • Circle grid
  • Loading
  • Empty
  • Error

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances