Skip to content
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, and image describe the track. duration is its length in seconds.
  • v-model:playing is true while it plays. The round button says "Play" or "Pause".
  • v-model:position is 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 previous and next. A click on the track emits open, 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 labels or a label pack: title, play, pause, previous, next, open, position, and time (a function).

Usage ​

ts
import { BlessMiniPlayer } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
title*string—
artiststring—
imagestring—
duration*number—the length in seconds
dockedboolean—stick to the bottom of the screen
labelsPartial<{ title: string; play: string; pause: string; previous: string; next: string; open: string; position: string; time: (now: string, total: string) => string; }>—
playingbooleanfalse
positionnumber0where the track is, in seconds

Events

NamePayloadDescription
open[]
next[]
update:playing[value: boolean]
previous[]
update:position[value: number]

Released under the MIT License. Character names and artwork belong to their owners.