Sparkline KPI Tile
A compact metric tile with a live dot, rolling numerals, a delta chip and a smooth sparkline that draws in, streams new points and shows a crosshair value on hover or ← →.
Try it: Hover the sparkline, or focus it and press ← →.
Installation
Install with the shadcn CLI:
npx shadcn@latest add https://www.framekitui.live/r/sparkline-kpi-tile.jsonOr, with the @framekit namespace registered: npx shadcn@latest add @framekit/sparkline-kpi-tile. You can also copy the source into components/ui/sparkline-kpi-tile.tsx (view on GitHub).
Usage
import { SparklineKpiTile } from '@/components/ui/sparkline-kpi-tile'Props
| Prop | Type | Default | Notes |
|---|---|---|---|
label / value / delta | string / number / number | Active users | Headline metric. |
data | number[] | generated | 0–100 series; passing data stops the live stream. |
liveMs | number | 2400 | Stream interval. |
color | string | '#7c5cff' | Line hue. |
className | string | — | Extra classes merged onto the root. |
Dependencies
motionlucide-react
Related Data Widgets components
- Spend Donut Card
A radial spend breakdown whose rounded arcs sweep in one after another; hovering or focusing a category pops its arc outward and rolls the centre total to that amount.
- Pastel Object Carousel
A cover-flow of pastel portrait cards with floating caption panels. A heavily damped spring carries drags; neighbours tuck behind at 85%, and each layered CSS-3D object (coins, calendar, key, lock…
- Contribution Heatmap Tile
A weeks × days activity heatmap: cells pop in on a diagonal wave, the total and streak roll up, and the grid is one roving tab stop where arrows move a ring that announces the day.
- Budget Area Card
A soft white squircle with a big rolling total, a delta pill and floating soft-3D banknotes. An indigo stepped area chart draws itself in with drifting sparkles and an end arrow, and a tooltip…
- Wallet Balance Card
A fanned stack of payment cards: picking one springs it to the front while the rest tuck behind, the balance rolls to the new amount and an eye toggle blurs the figures.
- Glow Histogram Card
A neon gradient histogram beside the ink stat card: bars rise on a soft spring with glowing caps that fade into the card, values drift live and hover / ← → lifts a bar with its value.