Lambchop
Data Display

Sparkline

Compact inline SVG chart for trend visualization.

import { Sparkline } from "lambchop";

Live Demo

Default

Green

Wide

Flat

Volatile

Usage

import { Sparkline } from "lambchop";

<Sparkline data={[1250, 1380, 1420, 1510, 1620, 1750, 1910, 2050]} />

Props

PropTypeDefaultDescription
datanumber[]Array of values to plot
widthnumber80SVG width in pixels
heightnumber24SVG height in pixels
colorstring"#3b82f6"Stroke and fill color
fillOpacitynumber0.1Opacity of the area fill
classNamestringAdditional CSS classes

Variants

  • Default — Blue accent sparkline
  • Custom Color — Green, red, or any hex color
  • Wide — Expanded width for more detail
  • Flat Data — Near-zero variance visualization
  • Volatile — High-variance data patterns