YuhuanStudioYunUIDocs
Patterns

Audio Player

Compact controls bar around an HTML5 audio element — play/pause, seek, time, and download.

A compact controls bar around an HTML5 <audio> element: play/pause, a seekable progress track, elapsed/total time, and an optional download button. Give it a src (a URL or object URL) — the host owns the blob lifecycle (e.g. URL.createObjectURL(blob)). Presentation only; no fetching.

Import

tsx
1import { AudioPlayer } from "@yuhuanowo/yunui/patterns";

Example

AudioPlayer

sample-tone.wav
0:00 / 0:00

Props

PropTypeDefaultDescription
autoPlaybooleanfalseBegin playing as soon as the source is ready.
classNamestring
downloadNamestringShow a download button linking to `src`; the value is the download filename.
labelsAudioPlayerLabelsLocalized `aria-label`s for the controls (defaults are English).
src*stringAudio source URL or object URL.
titlestringOptional title shown above the controls.

On this page