MiniPlayer

A compact player pill. The play button wears a progress ring, the title slides the way you skip, and the bars on the art settle when the music stops. Media.

Open playground
Low TidePale Harbor

About

MiniPlayer is a React component in the Media category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { MiniPlayer } from "@ashutoshswamy/smoui" and set tracks, autoPlay, onTrackChange.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { MiniPlayer } from "@ashutoshswamy/smoui";

<MiniPlayer tracks={[{ title: "Low Tide", artist: "Pale Harbor", duration: 192 }]} />

Props 3

tracks

The queue. A finished track starts the next.

{ title; artist; duration }[]
autoPlay

Default false.

boolean
onTrackChange

Fires on skip and on a track ending.

(index: number) => void