A rolling window of samples that scrolls one step per tick, with a dashed threshold, spike rings and chips that scroll with the line, and a head dot easing to the newest value.
pnpm dlx shadcn@latest add @beautiful-ui-pro/realtime-streamNeeds your registry key. Your components.json style picks the Base UI or Radix build: radix-*, new-york and default get Radix, base-* gets Base UI.
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 { RealtimeStream } from "@/components/ui/notchset/realtime-stream";
/** Push one sample a second and drop the oldest; the chart scrolls on each change. */
export function LatencyStream({ sample }: { sample: () => number }) {
const [buffer, setBuffer] = React.useState(() => Array.from({ length: 61 }, () => 150));
React.useEffect(() => {
const iv = setInterval(() => setBuffer((b) => [...b.slice(1), sample()]), 1000);
return () => clearInterval(iv);
}, [sample]);
return <RealtimeStream data={buffer} threshold={{ value: 400, label: "SLO 400MS" }} />;
}data–
number[]Oldest first; push one and drop one per tick.
live–
booleanScroll on new data.
threshold–
{ value, label }The dashed signal rule.
spikeAt / yMax / ticks / xLabels–
number / number[] / string[]Scale and spikes.
components/ui/notchset/realtime-stream.tsx
This component is included with Pro.
Try the live preview above. Get Pro to install the source.