Mini Player
betaA compact music card whose artwork crossfades and titles slide on a track change, with an equaliser, progress and transport controls.
- Display
- 1 file
- No extra npm packages
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add mini-playerNo npm packages are needed beyond what Dowel already requires.
import { MiniPlayer } from "@/components/ui/mini-player";Default
Demo
With Artwork
<MiniPlayer>
| Prop | Type | Default |
|---|---|---|
tracks (required) | MiniPlayerTrack[] | — |
defaultIndexInitial track index when uncontrolled. | number | 0 |
defaultPlayingInitial playing state when uncontrolled. | boolean | false |
indexControlled track index. | number | — |
labelThe group's accessible name. | string | "Music player" |
loopWrap from the last track to the first, and back. | boolean | true |
onIndexChange | (index: number) => void | — |
onPlayingChange | (playing: boolean) => void | — |
playingControlled playing state. | boolean | — |
progressControlled position in the current track, 0–1. Omit it and the card keeps its own clock. | number | — |
Plus every attribute of <div> except children.
A group named "Music player" with three real buttons: "Previous track", "Play"/"Pause" (the name changes with the state, as media players are announced) and "Next track", each with a visible focus ring. Position is a progressbar with a "0:42 of 3:10" value text that is never announced on its own. A track change is announced once in a polite live region. Artwork and the equaliser are aria-hidden. The progress bar and transport controls keep left-to-right order in right-to-left layouts, as media timelines do; the titles follow the page. Under reduced motion track changes land at once and the equaliser stops; the clock is real time and unaffected.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes