Loading component…
Loading component…
Browse covers in 3D – drag, flick or scrub the row, it springs to the nearest cover; images drift in their frames over a soft reflection
To reuse this local React demo, copy all files from the Code tab into the same folder, then import CoverFlow from ./cover-flow.
import { CoverFlow } from "@/components/ui/cover-flow";
export function Albums() {
return (
<CoverFlow
aria-label="New releases"
items={[
{ id: 1, title: "Low Tide", subtitle: "Mara Lind", image: "/covers/low-tide.jpg" },
{ id: 2, title: "Night Drive", subtitle: "Okto", image: "/covers/night-drive.jpg" },
{ id: 3, title: "Paper Moon", subtitle: "Ilse & June", image: "/covers/paper-moon.jpg" },
]}
onSelect={(item) => openAlbum(item.id)}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| items | CoverFlowItem[] | { id, title?, subtitle?, image?, alt?, cover? } – pass an image URL or any ReactNode as cover | |
| index | number | Controlled front cover – pair with onIndexChange | |
| defaultIndex | number | middle cover | Starting cover when uncontrolled |
| onIndexChange | (index: number) => void | Called whenever a different cover reaches the front, also while dragging | |
| onSelect | (item, index) => void | Clicking the front cover or pressing Enter – e.g. open a detail view | |
| itemWidth | number | 280 | Cover width in px – the whole row scales down in narrow containers (to half at most) |
| itemHeight | number | 280 | Cover height in px |
| angle | number | 50 | How far the side covers turn away, in degrees |
| reflection | boolean | true | Mirror the covers on the floor |
| caption | boolean | true | Title and subtitle of the front cover |
| renderCaption | (item, index) => ReactNode | Replaces the default caption | |
| controls | boolean | true | Previous and next buttons beside the caption |
| ticks | boolean | true | Small position ticks under the caption – clicking one jumps there |
| sound | boolean | false | A soft click each time a new cover reaches the front (Web Audio, no file) |
| aria-label | string | "Cover flow" | Names the carousel |
| className | string | Extra class on the root |
Scales with its container down to half size; touch-action pan-y keeps vertical swipes scrolling the page
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"
@import "tailwindcss"; in your main CSS file.