About
A tiny inline SVG trend line for a stat tile that draws in on scroll, ends on a highlighted dot at the latest value, and includes a spoken text summary of the trend.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Sparkline to your project and fits it to your theme.
Code
How Sparkline is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import Sparkline from "@/components/ui/sparkline";
export default function SparklineDemo() {
const data = [42, 45, 41, 48, 52, 50, 55, 58, 54, 60, 63, 61, 67, 72, 70];
return (
<div className="flex w-full items-center justify-center bg-background p-10">
<div className="w-full max-w-[220px] rounded-xl border border-border bg-card p-4 shadow-sm">
<p className="text-xs text-muted-foreground">Weekly revenue</p>
<p className="mt-1 text-2xl font-semibold tabular-nums text-foreground">
$72,000
</p>
<div className="mt-3">
<Sparkline data={data} label="Weekly revenue" />
</div>
</div>
</div>
);
}
















