VinylPlayer

A record you can touch. It spins with inertia, stops dead under your finger, and turning it scrubs the song. The tonearm drops on play, creeps toward the label as the song goes, and lifts on pause. Media.

Open playground
Paused

Low Tide

Pale Harbor

3:12

About

VinylPlayer 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 { VinylPlayer } from "@ashutoshswamy/smoui" and set title, duration, autoPlay among its 4 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

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

<VinylPlayer title="Low Tide" artist="Pale Harbor" duration={192} onPlayingChange={(p) => console.log(p)} />

Props 4

title / artist

What is playing.

string
duration

Length in seconds.

number
autoPlay

Start spinning on mount. Default false.

boolean
onPlayingChange

Fires on play, pause and reaching the end.

(playing: boolean) => void