Heart Rate
betaA live pulse monitor: an ECG trace swept by a write-head, a heart that beats with it, and the rate in bpm.
- Data
- 1 file
- 1 npm package
- Accessibility notes
- Draws on a canvas
Loading the example…
pnpm dlx @dowel-ui/cli add heart-ratenpm packages installed: class-variance-authority.
import { HeartRate } from "@/components/ui/heart-rate";Default
Statuses
Live
Small
<HeartRate>
| Prop | Type | Default |
|---|---|---|
bpm (required)Beats per minute. | number | — |
announceEveryMinimum time between spoken updates, in ms. Default 5000. | number | 5000 |
labelWhat is being measured, used in the accessible name. Default "Heart rate". | string | "Heart rate" |
size | "sm" | "md" | "md" |
status | "normal" | "warning" | "critical" | "normal" |
statusLabelText shown and read beside a warning or critical status. Defaults "Elevated" / "Critical". | string | — |
sweepSeconds of signal across the trace. Default 3. | number | 3 |
Plus every attribute of <div> except children.
A labelled group ("Heart rate", or `label`) whose rate is real text, so it is read as "72 bpm". The trace and the heart are aria-hidden decoration. Changes are announced in a polite role="status" region at most once per `announceEvery` ms (5 s by default), never on every beat. Status is not colour alone: warning and critical add a word ("Elevated", "Critical", or `statusLabel`) beside the rate. The loop stops off screen and in hidden tabs; under reduced motion the trace is drawn once, still, and the heart does not beat.
7/7
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — does not apply
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes