Loading component…
Loading component…
How fast an agent answers, hour by hour, like a blood-pressure chart – every hour as a bar from p50 to p95, pink above the target, the latest large and in blue
To reuse this local React demo, copy all files from the Code tab into the same folder, then import LatencyRange from ./latency-range.
import { LatencyRange, type LatencyPoint } from "@/components/ui/latency-range";
const points: LatencyPoint[] = hours.map((h) => ({
label: h.hour, // "14"
p50: h.p50Ms,
p95: h.p95Ms,
runs: h.runs,
}));
<LatencyRange title="Support agent latency" points={points} target={2500} onAction={() => openMetrics()} />| Name | Type | Default | Description |
|---|---|---|---|
| points | LatencyPoint[] | { label, p50, p95, runs? } – oldest first, the last one is now; labels must be unique, they keep the bars in place as new hours come in | |
| target | number | The p95 to stay under, in ms – a pink line; the part of a bar above it runs from pink to orange | |
| title | string | "Latency Range" | Heading on the frame |
| icon | ReactNode | A small mark before the title – defaults to a pulse, in pink | |
| actionLabel / onAction | string / () => void | "Open" | The button on the top right – it shows when onAction is given |
| formatMs | (ms: number) => string | "840ms" / "2.4s" | Formats every time |
| className | string | Extra class on the root |
Built on a container query; under 400px the two columns get tighter – the card keeps the same size as every agent chart card
The oldest hours fade out at the left edge
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"