A 40-point line on a scale fitted to the window, hollow MIN and MAX nodes with labels that never touch the line or leave the card, an end node with a halo, and a scrub that walks the line.
pnpm dlx shadcn@latest add https://beautiful-ui.dev/r/sparkline.jsonpnpm dlx shadcn@latest add https://beautiful-ui.dev/r/radix-nova/sparkline.jsonFree, no account or key. Use the command for your project's primitives: a radix-*, new-york or default style in components.json is Radix, a base-* style is Base UI. With the @beautiful-ui registry added, @beautiful-ui/<name> picks for you.
The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
Import it and pass your content. The props that matter most are listed next.
"use client";
import * as React from "react";
import { Sparkline } from "@/components/ui/notchset/sparkline";
const p50 = [2.3, 2.28, 2.2, 2.12, 2.1, 2.14, 2.11];
export function LatencySpark() {
const [point, setPoint] = React.useState<number | null>(null);
return (
<div className="grid gap-1">
<span className="font-mono text-xs">{(point ?? p50.at(-1)!).toFixed(2)}S P50</span>
<Sparkline values={p50} format={(v) => `${v.toFixed(1)}S`} onScrub={(_i, v) => setPoint(v)} />
</div>
);
}values–
number[]The window (resampled to 40).
format–
(v) => stringLabels.
pad–
numberLeast room above and below.
scaleLabel–
(lo, hi) => stringThe caption.
onScrub–
(i, v) => voidFor your header.
components/ui/notchset/sparkline.tsx