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.jsonAPI reference
Audio Player
| Prop | Type | Default | Description |
|---|---|---|---|
currentTime | number | — | Controls the playback position in seconds. |
duration | number | — | Defines the full audio duration. |
onToggle | () => void | — | Toggles playback. |
artworkUrl | string | — | Displays cover art beside the track details. |
onPrevious | () => void | — | Selects the previous track; otherwise rewinds 10 seconds using onChange. |
onNext | () => void | — | Selects the next track; otherwise advances 10 seconds using onChange. |
onOutput | () => void | — | Opens your audio-output picker when provided. |
onChange | (time: number) => void | — | Seeks to a new playback position. |