Skip to content

AudioPlayer

stablev1.0.0

Compact audio playback with waveform visualization. Played portion shown in temporal blue; unplayed in border-structure. Click waveform to seek. Supports controlled and uncontrolled modes. States: idle, playing, paused, loading (skeleton bars), error.

ConversationInteractivesince S22/Storybook ↗
import { AudioPlayer } from "@nodus/design-system/patterns"
Loading demo…
Interactive Preview — StorybookOpen in Storybook ↗

Props

src
Type stringDefault

Audio source URL. Used in uncontrolled mode.

waveform
Type number[]Default

Pre-computed amplitude data 0–1 per bar. Falls back to generated envelope when omitted.

duration
Type numberDefault

Duration in seconds. Required if src is not provided.

currentTime
Type numberDefault

Controlled playback position in seconds.

state
Type "idle" | "playing" | "paused" | "loading" | "error"Default

Controlled state. Uncontrolled when omitted.

onPlay
Type () => voidDefault

Called when playback is requested.

onPause
Type () => voidDefault

Called when pause is requested.

onSeek
Type (seconds: number) => voidDefault

Called when user seeks (click or keyboard).

errorMessage
Type stringDefault

Error message for error state.

label
Type stringDefault

Label shown above the player (e.g. Voice Recording).

barCount
Type numberDefault 60

Number of waveform bars to render.

Metadataidleplayingpausedloadingerrorsemantictypebordersurfacemotion
Design Rationale

This component was designed to express:

Explore Related

Was this helpful?