Realtime stream
ProA live feed of events arriving, with rate and recent history.
pnpm dlx shadcn@latest add @caliper/realtime-stream| Time | Value |
|---|---|
| 5s | 157.9541643231187 |
| 5.5s | 151.44982976156996 |
| 6s | 144.233600241796 |
| 6.5s | 136.75414596409675 |
| 7s | 129.4765031693114 |
| 7.5s | 122.85316043772968 |
| 8s | 117.29592514076215 |
| 8.5s | 113.1503192531425 |
| 9s | 110.67409647004709 |
| 9.5s | 110.02121633073867 |
| 10s | 111.23227176010585 |
| 10.5s | 114.23196519720224 |
| 11s | 118.83379023288825 |
| 11.5s | 124.75162767502225 |
| 12s | 131.61753505403223 |
| 12.5s | 139.0046235035733 |
| 13s | 146.45359964263446 |
| 13.5s | 153.50132221341852 |
| 14s | 159.70959796156367 |
| 14.5s | 164.69242637034517 |
| 15s | 168.13999930324218 |
| 15.5s | 169.8379633733353 |
| 16s | 169.68074739870144 |
| 16.5s | 167.6781263071802 |
| 17s | 163.95461337870472 |
| 17.5s | 158.7417186126258 |
| 18s | 152.3635545572527 |
| 18.5s | 145.21668456141302 |
| 19s | 137.74546638614572 |
| 19.5s | 130.4144241913318 |
When to use #
Use it for
- Watching incoming events, requests or trades as they happen.
- The user needs to see bursts and quiet periods.
Skip it when
- Data refreshes only now and then; a static chart is calmer.
- The numbers must be read exactly.
Installation #
pnpm dlx shadcn@latest add @caliper/realtime-stream
Adds its 4 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage #
Import it from your copy of the source. The example behind the preview comes with the source.
import { RealtimeStream } from "@/components/ui/realtime-stream"
The worked example comes with Pro
The 19-line example behind the preview opens here with a Pro or Team licence.
API reference #
RealtimeStream
component
Accessibility #
It exposes img and status semantics, with aria-label, aria-busy, aria-hidden and aria-pressed kept in step with state. Changes that matter are announced through a live region.
No custom key handling; Tab and the native activation keys do the work.
Motion #
It checks prefers-reduced-motion itself and settles immediately instead of travelling. Every state is still reachable.