Metronome
A pendulum metronome. The arm swings once per two beats and turns at each extreme exactly where the click falls; its weight slides down for faster tempos. The beats of the bar light in turn, the first accented.
Andante · beats per minute
Stopped
When to use
- Practice tools for musicians, dancers and runners.
- Any rhythm you want people to feel before they read it.
When not to use
- Sample-accurate audio; the click is scheduled per frame, so use a look-ahead scheduler.
- Decoration with no sound or beat behind it.
Installation
pnpm dlx shadcn@latest add @caliper/metronome
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.
API reference
Metronome
6 props
Also accepts the native props of its root element and a ref.
tapTempo
0 props
No props of its own; it accepts the native props of its root element.
tempoName
0 props
No props of its own; it accepts the native props of its root element.
BPM_MIN
helper
A helper exported alongside the component, not a component.
BPM_MAX
helper
A helper exported alongside the component, not a component.
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It exposes status semantics, with aria-hidden, aria-label and aria-pressed kept in step with state. Changes that matter are announced through a live region.
Motion
- State changes animate with the library's shared durations and curves, so its timing matches every other part.
- Under reduced motion each change lands on its end state without movement; nothing is hidden or skipped.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/metronome.mdThe index of every part is at /llms.txt.