Music Player

Now-playing card with a token-gradient cover that breathes with playback, title and artist that cross-fade in the skip direction, a draggable scrub bar with buffered and played layers, play/pause icon swap, shuffle and repeat-all/one toggles, volume slider with mute, and a queue drawer that slides up over the card; playback is simulated unless a track has a `src`.

Preview

Music Player preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/music-player
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

tracks
MusicTrack[]
—
index?
number

Controlled track index.

—
defaultIndex?
number
0
onIndexChange?
((index: number) => void)
—
playing?
boolean

Controlled playing state.

—
defaultPlaying?
boolean
false
onPlayingChange?
((playing: boolean) => void)
—
volume?
number

Controlled volume, 0–1.

—
defaultVolume?
number
0.8
onVolumeChange?
((volume: number) => void)
—
defaultShuffle?
boolean
false
defaultRepeat?
"all" | "off" | "one"
off
defaultQueueOpen?
boolean

Open the queue drawer initially.

false
className?
string
—

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.

Updated