Skip to content
← Inventory

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 label per 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 level from a real RMS meter while listening — 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

PropTypeDefaultDescription
level(required)number

Live RMS level, 0..1. Drives the bar heights while active.

activeboolean

When false, bars sit at the idle floor/undulation instead of tracking level.

barCountnumber6

Number of bars to render, 5..7.

classNamestring

Also exports

  • interfaceLiveWaveformProps

Composition

Builds on

Button