Sparkline

A tiny trend line for dashboards and tables. The line draws itself in, with a soft area and a dot on the latest value, plus a text summary for screen readers.

Install it the shadcn way: copy the source file into your project. It uses CSS 3D, Tailwind CSS v4 and Framer Motion, no WebGL.

Sparkline3D props

PropTypeDefaultDescription
datanumber[]The values to plot, oldest first. Needs at least two.
widthnumber120Width in pixels.
heightnumber36Height in pixels.
tone"accent" | "success" | "danger" | "neutral""accent"Colour of the line.
areabooleantrueFill the area under the line.
smoothbooleantrueRound the corners of the line.
aria-labelstring"Trend"Describes the data for screen readers, such as "Weekly visitors". A summary of the trend is added.
classNamestringExtra classes added to the outer element.

More components

Guides

Start

Cards

Scenes

Controls & text

Buttons

More cards

UI elements

Form controls

App components

Text & backgrounds

Showpieces

Blocks