Skip to content
caliper ui docs

Pro

Waveform player

A recording you can see. The waveform is the seek bar, the played part fills in as it plays, and the pointer shows the time under it before you press. Speed steps through 1×, 1.5× and 2×.

Pro
pnpm dlx shadcn@latest add @caliper/waveform-player

Ledger chime, v3

Sound review · 3 comments

0:00 / 0:00

Mara Chen at 0:12 · The second phrase lands better than v2.

Installs components/ui/waveform-player.tsxDepends on @radix-ui/react-slot, lucide-reactMotion shared motion tokens

When to use

Use it for

  • Call recordings, voice notes, podcasts and sound reviews in a product.
  • Anywhere loud and quiet parts help people find their place.

Skip it when

  • Video; use the media player.
  • Long recordings people navigate by chapter; add chapters with the media player.

Decisions

Why it is built this way, so you know what to keep when you change your copy.

Behaviour

Peaks stored or read
Pass peaks saved at upload for an instant draw, or leave them out and they are read from the file once.

Usage

A real slider
The waveform is a slider with the time as its value text; arrows skip five seconds, Space plays.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/waveform-player

Adds its 3 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. It is built from WaveformPlayer and audioPeaks.

example.tsx
import { WaveformPlayer, audioPeaks } from "@/components/ui/waveform-player"

The worked example comes with Pro

The 30-line example behind the preview opens here, ready to copy.

  • 576 Pro parts, blocks and page templates, all with source
  • $199 once, with a year of updates. What you have stays yours
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

WaveformPlayer

component
PropTypeDefaultDescription
src *string—
title *string—Names the recording for the slider and the play button.
peaksreadonly number[]—
barsnumber72
classNamestring—

audioPeaks

component

No props of its own; it accepts the native props of its root element.

Accessibility

It exposes slider semantics, with aria-label, aria-valuemin, aria-valuemax, aria-valuenow and aria-valuetext kept in step with state.

KeyBehaviour
SpaceActivates the focused control.

Motion

Transitions use the shared duration and easing tokens. Under prefers-reduced-motion those tokens collapse to instant and travel distances go to zero, so state changes still happen without movement.

All Media examples