‹ components

Sparkline

stablev1.0.0·open in canvas

Inline SVG trend line; tone follows series direction (sign discipline) unless overridden.

Installnpx shadcn add @cids/sparkline
Live demo

Motion · tap to replay

honors reduced-motion

None (data surfaces never bounce).

This component declares no motion.

Brand chip remounts on tap · highlighted tokens are named in this component's doc · spring is budgeted to human feedback only.

import { Sparkline } from "@/design-system";

<Sparkline data={closes} />
<Sparkline data={closes} label="7-day price trend" tone="neutral" />

Tokens · live

Resolves in the active theme — flip the toggle above to verify.

States · from doc

Parsed from the doc. Interact with the live demo for hover/active.

Static; re-renders with data.

Inline SVG trend line; tone follows series direction (sign discipline) unless overridden.

Anatomy

/\_/\__/  <- polyline, 1.25 stroke, buy/sell by direction
84 x 28 default box

Props

PropTypeDefaultNotes
datanumber[]--Oldest -> newest; needs >= 2 points (else renders nothing).
tone"buy" "sell" \"neutral"`directionDefault: last >= first -> buy.
labelstring--Sets role="img" + name; omitted = aria-hidden decorative.
width / heightnumber84 / 28Viewbox + rendered size.
classNamestring--cn-merged.

Motion

None (data surfaces never bounce).

A11y

Self-contained: copy the folder into any Tailwind+React app, or use the install command above. Docs and this page render the same file on disk — they cannot drift.