Heartbeat
betaAn ECG line with a bright pulse sweeping across it and a fading tail, above a heart that beats in time with the bpm reading.
- Data
- 1 file
- 1 npm package
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add heartbeatnpm packages installed: class-variance-authority.
import { Heartbeat } from "@/components/ui/heartbeat";Default
Demo
Changing Rate
Accent
<Heartbeat>
| Prop | Type | Default |
|---|---|---|
bpmBeats per minute. Sets both the reading and the tempo of the sweep and the heart. | number | 72 |
labelRead before the number by assistive technology. | string | "Heart rate" |
size | "sm" | "md" | "lg" | "md" |
unitThe unit shown after the number. | string | "bpm" |
Plus every attribute of <div> except children.
The trace and heart glyph are aria-hidden; the reading is plain text prefixed by a visually hidden `label`, so it reads "Heart rate 72 bpm". It is deliberately not a live region, since a reading that updates constantly would never stop announcing. The sweep and beat are decorative loops: under reduced motion they stop and the full trace is shown bright and still.
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