A horizontal Spotify music card with blurred album art background, an animated vinyl record that peeks out on play, seek bar, and playback controls.
Installation
This component requires a /api/spotify route in your Next.js app. Add spotify-url-info to your project and create the route:
Usage
How It Works
- Fetches track metadata (title, artist, artwork, preview audio) via
GET /api/spotify?url=.... - The album artwork is rendered as a heavily blurred full-bleed background layer with a dark gradient overlay for text legibility.
- Clicking the album art starts the 30-second preview; a vinyl record SVG slides out from behind the cover and spins while audio plays.
- The seek bar uses a custom
.spotify-seekCSS class (add it to yourglobals.css). - Size variants (
md,lg,xl) scale padding, artwork size, and typography together.
API Reference
SpotifyCard
| Prop | Type | Default |
|---|---|---|
url? | string | - |
size? | "md" | "lg" | "xl" | "md" |
className? | string | - |
onPrev? | () => void | - |
onNext? | () => void | - |