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






















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 soonManual
1. Install dependencies:
npm install motion
2. Copy the component code into components/coverflow.tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| items | CoverFlowItem[] | - | Array of items to display. |
| itemWidth | number | 400 | Width of each card in pixels. |
| itemHeight | number | 400 | Height of each card in pixels. |
| stackSpacing | number | 100 | Spacing between stacked cards. |
| centerGap | number | 250 | Gap between the center card and the stack. |
| rotation | number | 50 | Rotation angle (in degrees) for stacked cards. |
| initialIndex | number | 0 | Index of the initially selected item. |
| enableReflection | boolean | true | Enable or disable reflection effect. |
| onItemClick | function | - | Callback when an item is clicked. |
| onIndexChange | function | - | Callback when the active index changes. |