Mark Yo

Sparkline

Dashboards

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>
  );
}

Dependencies

More by Mark Yo

View all
  • Loader

    Loader

    67
  • Pricing Table

    Pricing Table

    24
  • Bento Grid

    Bento Grid

    10
  • Wallet Card

    Wallet Card

    4
  • Expandable Tabs

    Expandable Tabs

    4
  • Image Gallery

    Image Gallery

    3
  • CTA Section

    CTA Section

    3
  • Bar Chart

    Bar Chart

    1

More in Dashboards

View all
  • Creator Dashboard

    Creator Dashboard

    94
  • serf dashboard

    serf dashboard

    84
  • Dashboard with Collapsible Sidebar

    Dashboard with Collapsible Sidebar

    2.6K
  • Glass Dashboard

    Glass Dashboard

    1.1K
  • Adjustable Glass Dashboard

    Adjustable Glass Dashboard

    1.2K
  • App Dashboard Layout

    App Dashboard Layout

    572
  • Sidebar

    Sidebar

    422
  • Dashboard Shell

    Dashboard Shell

    215