Skip to Content
Kokonut UI

CD-03Cards

Now Playing

Music card with a spinning disc you can grab and turn to scrub, built with React and Tailwind CSS.

Install with
class-variance-authority, lucide-react

PROOnboarding Checklist and more like it are in Kokonut UI Pro

Installation

Now Playing is a free, open-source React component in the Kokonut UI Cards collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/liquid-glass-card.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/liquid-glass-card

Or add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/liquid-glass-card.tsx.

npm install class-variance-authority lucide-react

Usage

import NowPlaying from "@/components/kokonutui/liquid-glass-card";

export default function Example() {
  return <NowPlaying />;
}

Props

tracks
NowPlayingTrack[]Default built-in
defaultTrack
numberDefault 0

Index of the track loaded first.

autoPlay
booleanDefault true

Start playing on mount.

accent
stringDefault "#f97316"

The one accent colour: meter, progress and label art.

glassEffect
booleanDefault false

Wraps the card in the glass shadow and SVG refraction (Chromium only).

onTrackChange
(index: number) => void
className
string

Extra classes for the root element.

NowPlayingTrack

titlerequired
string
artistrequired
string
durationrequired
number

Length in seconds.

artwork
number

Which built-in label design is printed on the disc (0, 1 or 2).

Dependencies

NeedsVersionComes from
class-variance-authority^0.7.1npm, installed by the CLI
lucide-react^0.556.0npm, installed by the CLI
cardshadcn/ui, added by the CLI
buttonshadcn/ui, added by the CLI
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.