ganapativs

SparkBar

Component

About

A tiny zero-anchored bar chart (an SVG "sparkbar") for showing discrete per-period counts inline, or a win-loss-tie streak in a compact word-sized box.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds SparkBar to your project and fits it to your theme.

Code

How SparkBar is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { SparkBar } from "@/components/ui/sparkbar";

export default function SparkBarDemo() {
  return (
    <div className="flex items-center justify-center p-10">
      <SparkBar
        data={[1, -1, 1, 1, -1, 1, -1]}
        width={130}
        height={32}
        mode="winloss"
        title="Win\u2013loss streak"
      />
    </div>
  );
}

More by ganapativs

View all
  • Delta Indicator

    Delta Indicator

  • Dumbbell Chart

    Dumbbell Chart

  • Calendar Strip

    Calendar Strip

  • Heat Strip

    Heat Strip