Atelier UI

Search components…

Search components…

Sparkline

Tiny responsive SVG line/area chart with gradient fill, last-point dot and up/down trend colors.

Edit in sandbox

Copy a prompt for your AI coding tool with the source, dependencies and usage

Props

SparklineProps

Also accepts all props of Omit<React.ComponentProps<"div">, "children">

PropTypeDefaultDescription
data* requirednumber[]——
trend"auto" | "up" | "down" | "primary""auto""auto" colours by first-vs-last value; "primary" uses the theme primary colour
areabooleantrueDraw the gradient area under the line
showDotbooleantrueDraw a dot on the last point
strokeWidthnumber2—
labelstring—Accessible description; defaults to an automatic summary

Install

$ npx shadcn@latest add https://chromotion.dev/r/sparkline.json

More like this