Skip to content
Browse docs and components

Waveform

waveform

A row of bars for anything that makes or hears sound. Loops on its own while listening or speaking, follows a level or an AnalyserNode's spectrum when given one, and sends a pulse across while thinking.

Responsive

Install

$npxshadcnadd@forme/waveform

Adds the component, its registry dependencies, and the token stylesheet you import once.

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

Waveform

A row of bars for anything that makes or hears sound: a recording, a reply being spoken, a model thinking. Idle is a still, low row; listening and speaking loop on their own, or follow level or an AnalyserNode when given one; thinking is a pulse travelling across. Colour is currentColor, so a text class recolours it — text-primary-foreground inside a filled button.

PropTypeDefaultDescription
state'idle' | 'listening' | 'thinking' | 'speaking'"listening"
levelnumber—Loudness, 0–1. While listening or speaking, the bars follow it instead of looping.
analyserAnalyserNode | nullnullA caller-owned analyser. While listening or speaking each bar reads its own slice of the spectrum, so the row is a real equaliser. Never opens a microphone itself.
barsnumber5How many bars. Odd counts keep a centre bar, which reads as the loudest.
classNamestring—
aria-labelstring—Pass "" when a visible caption already says what the bars show.