Skip to content
caliper ui pro docs

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.

Pro

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

terminal
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.

PropTypeDefaultDescription
bpmnumber—
defaultBpmnumber96
onBpmChange((bpm: number) => void)—
beatsnumber4Beats in a bar; the first is accented.
defaultSoundbooleantrueStarts with the click on. It never sounds until Start is pressed.
onBeat((beat: number) => void)—Called on every beat with its position in the bar, from 0.

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.md

The index of every part is at /llms.txt.

More in Changing values