Skip to main content

Sparkline

Axis-less inline trend.

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

When to use​

Axis-less inline trend.

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/sparkline
import { Sparkline } from '@/components/prism/Sparkline';

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

Props​

PropTypeRequiredDescription
datanumber[]Yes
heightnumber—
colorstring—
areaboolean—
strokeWidthnumber—
labelstring—