Controls

Tick Tape

Preview
Reduced motion

Simulates prefers-reduced-motion for the demo. Off follows your system setting.

Keyboard stepping

Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.

Tick Tape

Requests

per second
0
p95
0 ms
errors
0%

Tick Tape

A live tape of events, one thin line each, as tall as its value.

Installation

npx shadcn@latest add ikislay/pixel-ui/tick-tape

How to use

import { 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" />
}

Source Code

// Loading…

Props

Options you can pass to customize this component.

Prop
Type
Description
ref
Ref<{ 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*
string

Names the chart for screen readers and captions its data table.

seconds
number

How many seconds of events the tape shows.

height
number

Height of the tape in pixels. The width fills the parent.

format
(value: number) => string

Formats the p95 figure and the readout. Defaults to whole milliseconds like 240 ms.

color
string

Any CSS color for events that are not errors.

className
string

Merged onto the root element.