Get Started

Install the component via CLI or copy the source code directly into your project.

Usage

Sanemi Shinazugawa
Obanai Iguro
Mitsuri Kanroji
Giyu Tomioka
Shinobu Kocho
Kanao Tsuyuri
Tanjiro Kamado
Nezuko Kamado
Zenitsu Agatsuma
Inosuke Hashibira
Muichiro Tokito

Kanao Tsuyuri

"use client";

import { CoverFlow, CoverFlowItem } from "@/components/ui/coverflow";

const animeItems: CoverFlowItem[] = [
  { id: 1, image: "/anime/Shinazugawa.jpeg", title: "Sanemi Shinazugawa" },
  { id: 2, image: "/anime/Obanai.jpeg", title: "Obanai Iguro" },
  { id: 3, image: "/anime/Mitsuri.jpeg", title: "Mitsuri Kanroji" },
  { id: 4, image: "/anime/giyu.jpeg", title: "Giyu Tomioka" },
  { id: 5, image: "/anime/Shinobu.jpeg", title: "Shinobu Kocho" },
  { id: 6, image: "/anime/kanao.jpeg", title: "Kanao Tsuyuri" },
  { id: 7, image: "/anime/Tanjiro.jpeg", title: "Tanjiro Kamado" },
  { id: 8, image: "/anime/Nezuko.jpeg", title: "Nezuko Kamado" },
  { id: 9, image: "/anime/Zenitsu.jpeg", title: "Zenitsu Agatsuma" },
  { id: 10, image: "/anime/Inosuke.jpeg", title: "Inosuke Hashibira" },
  { id: 11, image: "/anime/tokitou.jpeg", title: "Muichiro Tokito" },
];

export default function CoverFlowDemo() {
  return (
    <div className="h-[400px] w-full border-b border-border/40 relative bg-background">
      <CoverFlow
        items={animeItems}
        itemWidth={250}
        itemHeight={250}
        initialIndex={3}
        enableReflection={true}
      />
    </div>
  );
}

Installation

CLI
coming soon
Manual

1. Install dependencies:

npm install motion

2. Copy the component code into components/coverflow.tsx

View Source

Props

PropTypeDefaultDescription
itemsCoverFlowItem[]-Array of items to display.
itemWidthnumber400Width of each card in pixels.
itemHeightnumber400Height of each card in pixels.
stackSpacingnumber100Spacing between stacked cards.
centerGapnumber250Gap between the center card and the stack.
rotationnumber50Rotation angle (in degrees) for stacked cards.
initialIndexnumber0Index of the initially selected item.
enableReflectionbooleantrueEnable or disable reflection effect.
onItemClickfunction-Callback when an item is clicked.
onIndexChangefunction-Callback when the active index changes.