Calm motion: animations on this site only fade, with no movement
Mini player
A small player that stays on the screen, with the track and the controls
Keeps the sound going while the listener moves through an app. It shows the state and sends the actions. Your app plays the sound, for example with the audio player or an audio element.
Basic
title,artist, andimagedescribe the track.durationis its length in seconds.v-model:playingis true while it plays. The round button says "Play" or "Pause".v-model:positionis the place in seconds. A thin native slider across the top shows it and moves it. Screen readers hear the time, such as "12:34 of 44:00".- The ⏮ and ⏭ buttons emit
previousandnext. A click on the track emitsopen, for a full player. - With
docked, the player sticks to the bottom of the screen. - On narrow screens, the time hides. The slider still says it.
- Change the words with
labelsor a label pack:title,play,pause,previous,next,open,position, andtime(a function).
Usage
ts
import { BlessMiniPlayer } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
title* | string | — | |
artist | string | — | |
image | string | — | |
duration* | number | — | the length in seconds |
docked | boolean | — | stick to the bottom of the screen |
labels | Partial<{ title: string; play: string; pause: string; previous: string; next: string; open: string; position: string; time: (now: string, total: string) => string; }> | — | |
playing | boolean | false | |
position | number | 0 | where the track is, in seconds |
Events
| Name | Payload | Description |
|---|---|---|
open | [] | |
next | [] | |
update:playing | [value: boolean] | |
previous | [] | |
update:position | [value: number] |