LiveWaveform
A dumb, props-driven voice waveform: a row of bars whose heights track a live
level through a spring, animated with transform: scaleY() only (never
height, so it stays on the compositor). When active is false — or the
user prefers reduced motion — the bars drop to a floor with a slow, phase-
offset idle undulation instead of tracking the input.
Usage
import { LiveWaveform, LiveWaveformProps } from "@desk/ui/components/voice";Best practices
Keep this dumb — drive every transition from the parent through
state/level/elapsedMs; it owns no timers, audio, or permissions.Pass
labelper state (the parent decides the copy, e.g. "Voice input" vs "Stop dictation") so screen readers announce the current action; never hardcode it here.Feed
levelfrom a real RMS meter whilelistening— a dead-flat waveform reads as a crashed mic; the atom floors and undulates the bars, but only live level makes it look alive.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| level | number | Live RMS level, | |
| active | boolean | When | |
| barCount | number | 6 | Number of bars to render, |
| className | string |
Also exports
- interface
LiveWaveformProps
Composition
Builds on