Componentcharts0.62 KB gzipZero dependencies

Sparkline

Lightweight SVG trend sparkline with animated end-point.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add sparkline

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { Sparkline } from "@/components/ui/sparkline"; <Sparkline data={[10, 25, 18, 42, 35, 60, 52, 85]} tone="accent" />

Source code

sparkline.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxsparkline.tsx95 lines
import * as React from "react";import { cn } from "./lib/utils"; export interface SparklineProps extends React.SVGAttributes<SVGSVGElement> {  data: number[];  width?: number;  height?: number;  strokeWidth?: number;  tone?: "accent" | "foreground";  showArea?: boolean;  className?: string;} export function Sparkline({  data,  width = 140,  height = 40,  strokeWidth = 2,

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { Sparkline } from "@/components/ui/sparkline"; <Sparkline />
PropTypeDescription
datanumber[]Dataset array rendered in charts, grids, or tables.
widthnumberConfigures width. (Default: 140)
heightnumberConfigures height. (Default: 40)
strokeWidthnumberConfigures stroke width. (Default: 2)
tone"accent" | "foreground"Semantic surface or emphasis tone. (Default: "accent")
showAreabooleanToggles show area. (Default: true)
classNamestringOptional Tailwind or custom CSS classes merged with component styles.