Skip to content
Get Pro

Audio Player

A controlled playback surface for speech, generated audio, and recorded tool output.

Loading component preview…

Installation

Add the component source directly to your project.

pnpm dlx shadcn@latest add https://pastaui.com/r/audio-player.json

API reference

Audio Player

Audio Player properties
PropTypeDefaultDescription
currentTimenumberControls the playback position in seconds.
durationnumberDefines the full audio duration.
onToggle() => voidToggles playback.
artworkUrlstringDisplays cover art beside the track details.
onPrevious() => voidSelects the previous track; otherwise rewinds 10 seconds using onChange.
onNext() => voidSelects the next track; otherwise advances 10 seconds using onChange.
onOutput() => voidOpens your audio-output picker when provided.
onChange(time: number) => voidSeeks to a new playback position.