127 Components

Scrubbable Sparkline

Motion

Robinhood-style financial stock and cryptocurrency sparkline chart with interactive touch/mouse scrubbing, dynamic cursor crosshair, live price readout, and animated delta gains or losses.

BitcoinBTC/USD
+6.37%

$68,340.00

Live Market

Installation

Install directly into your project using the shadcn CLI or copy the source code manually.

Requires:framer-motionlucide-reactclsxtailwind-merge
$npx shadcn@latest add "https://boseui.site/r/scrubbable-sparkline.json"

Props

TypeScript props supported by <ScrubbableSparkline />.

9 props
PropTypeDefaultDescription
dataSparklinePoint[]—Array of sparkline points with time string and numeric value.
titlestring"Bitcoin"Title of the asset or financial instrument.
tickerstring"BTC/USD"Ticker symbol displayed in the header badge.
currencystring"$"Currency symbol prefix for price formatting.
heightnumber240SVG viewport coordinate height in pixels.
showGradientbooleantrueWhether to render the animated area fill gradient underneath the line.
showGridbooleantrueWhether to render horizontal reference grid lines.
classNamestring—Additional CSS classes to apply to the root container.
minimalboolean—Compact sparkline display mode hiding telemetry header and stats

Key Features

  • Interactive pointer and touch scrubbing with smooth cubic bezier SVG curve calculation.
  • Dynamic delta percentage computation with conditional emerald (gain) or rose (loss) theme.
  • Live vertical crosshair indicator with glowing cursor dot tracking the curve value.
  • Smooth animated SVG area gradient fill with configurable glow and gridlines.
  • Responsive SVG coordinate scaling across desktop and mobile screens.

Keyboard & Accessibility

  • Provides tabular data fallback and aria-label readouts for screen readers.
  • Maintains high contrast color ratios for gains (emerald) and losses (rose).
  • Supports keyboard reset and touch dragging without trapping scroll.