Skip to main content

Legend

Standalone chart legend (LineChart/BarChart/DonutChart render their own).

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When to use​

Standalone chart legend (LineChart/BarChart/DonutChart render their own).

Accessibility​

Each chart ships an accessible fallback (a visually-hidden data table / aria-label summary) so the data is available to screen readers, not just sighted users. Colour is paired with shape/label, never used alone.

Install and import​

npx shadcn@latest add @prism/legend
import { Legend } from '@/components/prism/Legend';

In a no-build prototype, read it from the bundle instead: const { Legend } = window.PrismDesignSystem_39d121;

Props​

PropTypeRequiredDescription
itemsLegendItem[]Yes
shape"square" | "line" | "dot"—
align"start" | "center"—