Command Palette

Search for a command to run...

Docs
Playlist Carousel

Playlist Carousel

Horizontal scrolling playlist with individual audio players and progress indicators

Loading...

Installation

Usage

import PlaylistCarousel from "@/components/ruixen/playlist-carousel";
 
const playlistItems = [
  {
    id: "1",
    title: "Song Title 1",
    duration: "3:45",
    image: "https://example.com/cover1.jpg",
    audioSrc: "https://example.com/song1.mp3",
  },
  {
    id: "2",
    title: "Song Title 2",
    duration: "4:12",
    image: "https://example.com/cover2.jpg",
    audioSrc: "https://example.com/song2.mp3",
  },
];
 
export default function App() {
  return <PlaylistCarousel items={playlistItems} width={200} height={250} />;
}

Props

PropTypeDefaultDescription
itemsPlaylistItem[]-Array of playlist items
widthnumber200Width of each card
heightnumber250Height of each card
classNamestring-Additional CSS classes

Features

  • Horizontal Scrolling: Smooth carousel navigation
  • Individual Players: Each item has its own play/pause control
  • Progress Indicators: Linear and circular progress bars
  • Album Artwork: Display cover images
  • Time Display: Current time and total duration
  • Auto-Stop: Stops other tracks when playing new one

PlaylistItem Type

export interface PlaylistItem {
  id: string;
  title: string;
  duration: string;
  image: string;
  audioSrc: string;
}