Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

AudioPlayer

Browse and play locally bundled design-note episodes.

Preview

Live preview

Changes apply to this preview only.

Pimolu / Play

Find your rhythm

Action gameLocal soundtrack
0:00 / 0:00

A moment to play

Pixel art gameVolume and timeline controls
0:00 / 0:00

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Episode

The title doubles as the accessible name of the player unless an explicit aria-label is given.

Open preview

Minimal

Hide the volume slider and the time readout when space is tight; the mute button and the seek bar remain.

Open preview

Controlled playback

`playing` and `onPlayingChange` let a parent coordinate several players, a transcript or an external transport bar.

Open preview

Usage

Keep the playlist state and current track synchronized; avoid unsolicited audio playback.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluAudioPlayerLabels

Type source
PimoluAudioPlayerLabels public API
NameTypeDefaultDescription
playerstring | undefined—Accessible name when neither `aria-label` nor `title` is given.
playstring | undefined"Play"Defaults to "Play".
pausestring | undefined"Pause"Defaults to "Pause".
mutestring | undefined"Mute"Defaults to "Mute".
unmutestring | undefined"Unmute"Defaults to "Unmute".
volumestring | undefined"Volume"Defaults to "Volume".
timelinestring | undefined"Audio timeline"Defaults to "Audio timeline".
player

string | undefined

No default extracted.

Accessible name when neither `aria-label` nor `title` is given.

play

string | undefined

Default: "Play"

Defaults to "Play".

pause

string | undefined

Default: "Pause"

Defaults to "Pause".

mute

string | undefined

Default: "Mute"

Defaults to "Mute".

unmute

string | undefined

Default: "Unmute"

Defaults to "Unmute".

volume

string | undefined

Default: "Volume"

Defaults to "Volume".

timeline

string | undefined

Default: "Audio timeline"

Defaults to "Audio timeline".

PimoluAudioPlayerProps

Type source
PimoluAudioPlayerProps public API
NameTypeDefaultDescription
srcRequiredstring—Audio URL.
titlestring | undefined—Track name, also used as the accessible name of the player.
subtitleReactNode—Artist, album or a short description under the title.
playingboolean | undefined—Controlled playback state. Omit to let the player own it.
onPlayingChange((playing: boolean) => void) | undefined—Called whenever playback starts or stops.
mutedboolean | undefinedfalseInitial muted state when the player mounts. Defaults to false.
defaultVolumenumber | undefined1Initial volume, from 0 to 1. Defaults to 1.
seekStepnumber | undefined5Seconds skipped by ArrowLeft and ArrowRight. Defaults to 5.
showVolumeboolean | undefinedtrueShow the volume slider next to the mute button. Defaults to true.
showTimeboolean | undefinedtrueShow the current and total time. Defaults to true.
classNamestring | undefined—Class applied to the player wrapper.
audioClassNamestring | undefined—Class applied to the native `<audio>`.
labelsPimoluAudioPlayerLabels | undefined—Localizable control labels.
onLoadedMetadataReactEventHandler<HTMLAudioElement> | undefined—Public Pimolu prop; see the source declaration for details.
onTimeUpdateReactEventHandler<HTMLAudioElement> | undefined—Public Pimolu prop; see the source declaration for details.
onPlayReactEventHandler<HTMLAudioElement> | undefined—Public Pimolu prop; see the source declaration for details.
onPauseReactEventHandler<HTMLAudioElement> | undefined—Public Pimolu prop; see the source declaration for details.
onEndedReactEventHandler<HTMLAudioElement> | undefined—Public Pimolu prop; see the source declaration for details.
onVolumeChangeReactEventHandler<HTMLAudioElement> | undefined—Public Pimolu prop; see the source declaration for details.
onDurationChangeReactEventHandler<HTMLAudioElement> | undefined—Public Pimolu prop; see the source declaration for details.
onChangeChangeEventHandler<HTMLAudioElement, Element> | undefined—Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onClickMouseEventHandler<HTMLAudioElement> | undefined—Standard React/HTML attribute.
srcRequired

string

No default extracted.

Audio URL.

title

string | undefined

No default extracted.

Track name, also used as the accessible name of the player.

subtitle

ReactNode

No default extracted.

Artist, album or a short description under the title.

playing

boolean | undefined

No default extracted.

Controlled playback state. Omit to let the player own it.

onPlayingChange

((playing: boolean) => void) | undefined

No default extracted.

Called whenever playback starts or stops.

muted

boolean | undefined

Default: false

Initial muted state when the player mounts. Defaults to false.

defaultVolume

number | undefined

Default: 1

Initial volume, from 0 to 1. Defaults to 1.

seekStep

number | undefined

Default: 5

Seconds skipped by ArrowLeft and ArrowRight. Defaults to 5.

showVolume

boolean | undefined

Default: true

Show the volume slider next to the mute button. Defaults to true.

showTime

boolean | undefined

Default: true

Show the current and total time. Defaults to true.

className

string | undefined

No default extracted.

Class applied to the player wrapper.

audioClassName

string | undefined

No default extracted.

Class applied to the native `<audio>`.

labels

PimoluAudioPlayerLabels | undefined

No default extracted.

Localizable control labels.

onLoadedMetadata

ReactEventHandler<HTMLAudioElement> | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

onTimeUpdate

ReactEventHandler<HTMLAudioElement> | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

onPlay

ReactEventHandler<HTMLAudioElement> | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

onPause

ReactEventHandler<HTMLAudioElement> | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

onEnded

ReactEventHandler<HTMLAudioElement> | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

onVolumeChange

ReactEventHandler<HTMLAudioElement> | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

onDurationChange

ReactEventHandler<HTMLAudioElement> | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

onChange

ChangeEventHandler<HTMLAudioElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onClick

MouseEventHandler<HTMLAudioElement> | undefined

No default extracted.

Standard React/HTML attribute.

Accessibility

  • Name playback and seeking controls and offer a transcript for spoken audio.
Read the accessibility guide →