A squeezebox-alike React frontend for controlling go-librespot.
Use it as:
- a standalone page for touchscreens
- an embedded component in internal dashboards
- Layout modes:
auto,default,widescreen,portrait - Views:
Info,Playlists,Queue,Settings - Interactive album art card: tap to browse the current album, playlist, or show
- In-app navigation from now playing metadata to album, artist, and show details
- Browse playlists: view tracks with lazy-loaded metadata, play individual tracks
- Browse artists: portrait image, biography, top tracks, albums, singles, related artists
- Browse albums: tracklist with durations, explicit badges, clickable artist links
- Browse shows: episodes with durations and publish dates
- Playlist cards with cover art, name, description, owner, track count
- Paginated playlist loading with infinite scroll
- Client-side image URL normalization for Spotify CDN compatibility
- Comes with a set of preset themes and sleep timer
- Podcast controls include skip back 15s and skip forward 30s
This UI needs a go-librespot instance with:
- HTTP API: player controls, metadata endpoints (
/metadata/rootlist,/metadata/playlist/{id},/metadata/track/{id},/metadata/album/{id},/metadata/artist/{id},/metadata/show/{id},/metadata/episode/{id}) - WebSocket event stream at
/events - All metadata is fetched via Spotify's native Mercury/protobuf protocols (no Spotify Web API keys needed)
Create a .env file:
REACT_APP_API_BASE_URL=http://apollo:3678
REACT_APP_WS_URL=ws://apollo:3678/events
REACT_APP_KIOSK_MODE=false
REACT_APP_HIDE_ON_DISCONNECT=false
REACT_APP_LAYOUT=autoInstall and run:
npm install
npm run test
npm run static
npm run buildCommands:
npm run test: starts the local demo appnpm run static: creates the static app buildnpm run build: builds the npm package output indist/
Install:
npm install --save @stronk-tech/react-librespot-controllerUse:
import MediaPlayer from "@stronk-tech/react-librespot-controller";
<MediaPlayer
websocketUrl="ws://apollo:3678/events"
apiBaseUrl="http://apollo:3678"
hideOnDisconnect={false}
kioskMode={false}
layout="auto"
theme="tokyo-night"
/>;websocketUrl: WebSocket URL forgo-librespoteventsapiBaseUrl: HTTP API base URL forgo-librespothideOnDisconnect: hides the component when API connection is downkioskMode: uses full-screen behaviorlayout:auto,default,widescreen,portraittheme: optional preset name; if omitted, saved theme is used, default istokyo-night
tokyo-night, tokyo-night-light, dracula, nord, catppuccin, catppuccin-light, gruvbox, gruvbox-light, one-dark, github-dark, rose-pine, solarized, solarized-light, ayu-mirage






