Skip to content
Components

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, VoiceErrorPopover, VoiceErrorPopoverProps, VoicePill, VoicePillProps, VoicePillState } from "@instruments/materia-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

LiveWaveform

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

VoiceErrorPopover

PropTypeDefaultDescription
open(required)boolean

Controlled visibility. The parent owns error state and dismissal.

message(required)string

The error message to surface.

actionLabelstring

When set, renders an action button (e.g. "Retry") that calls onAction.

onAction() => void
onDismiss() => void
dismissLabelstring"Dismiss"

Accessible label for the dismiss button.

children(required)ReactNode

The anchor - the pill. The popover is positioned above it.

classNamestring

VoicePill

PropTypeDefaultDescription
state(required)VoicePillState

Current visual state. The parent owns all transitions between states.

levelnumber0

Live RMS level 0..1, used while listening/finalizing.

elapsedMsnumber0

Elapsed capture time in ms, shown as an mm:ss timer while recording.

onClick() => void
disabledboolean
label(required)string

Accessible label. The parent chooses copy per state - never hardcoded here.

pressedboolean

Maps to aria-pressed (e.g. true while listening).

classNamestring

Also exports

  • interfaceLiveWaveformProps
  • interfaceVoiceErrorPopoverProps
  • interfaceVoicePillProps
  • typeVoicePillState

Composition

Builds on

Button, Flex, Icon