Simulates prefers-reduced-motion for the demo. Off follows your system setting.
Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.
1
Requests
A live tape of events, one thin line each, as tall as its value.
npx shadcn@latest add ikislay/pixel-ui/tick-tapeimport { useEffect, useRef } from "react"import { TickTape, type TickTapeHandle } from "@/components/ui/tick-tape"export function Demo() {const tape = useRef<TickTapeHandle>(null)useEffect(() => {const timer = setInterval(() => {tape.current?.push({ value: 40 + Math.random() * 300, label: "GET /orders" })}, 150)return () => clearInterval(timer)}, [])return <TickTape ref={tape} label="Requests" />}
1// Loading…
Options you can pass to customize this component.
refRef<{ push: (event: TickTapeEvent | TickTapeEvent[]) => void; clear: () => void }>Push events from your own stream, one or many at a time. An event is { value, error?, label?, time? }; time defaults to now.
label*stringNames the chart for screen readers and captions its data table.
secondsnumberHow many seconds of events the tape shows.
heightnumberHeight of the tape in pixels. The width fills the parent.
format(value: number) => stringFormats the p95 figure and the readout. Defaults to whole milliseconds like 240 ms.
colorstringAny CSS color for events that are not errors.
classNamestringMerged onto the root element.