Cover flow preview

Cover flow

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

  • Group
    Card illustrations
  • Origin
    Copied · affectUI · source
  • License
    MIT
  • Added
    Oct 18
npx shadcn@latest add @deank/cover-flow

The registry stays private. Install from the repo with a GitHub token — see the README.

Usage

import { CoverFlow } from "@/registry/blocks/cover-flow/cover-flow";

<CoverFlow items={[/* … */]} />

Props

NameTypeDefaultDescription
itemsCoverFlowItem[]{ id, title?, subtitle?, image?, alt?, cover? } – pass an image URL or any ReactNode as cover
indexnumberControlled front cover – pair with onIndexChange
defaultIndexnumbermiddle coverStarting cover when uncontrolled
onIndexChange(index: number) => voidCalled whenever a different cover reaches the front, also while dragging
onSelect(item, index) => voidClicking the front cover or pressing Enter – e.g. open a detail view
itemWidthnumber280Cover width in px – the whole row scales down in narrow containers (to half at most)
itemHeightnumber280Cover height in px
anglenumber50How far the side covers turn away, in degrees
reflectionbooleantrueMirror the covers on the floor
captionbooleantrueTitle and subtitle of the front cover
renderCaption(item, index) => ReactNodeReplaces the default caption
controlsbooleantruePrevious and next buttons beside the caption
ticksbooleantrueSmall position ticks under the caption – clicking one jumps there
soundbooleanfalseA soft click each time a new cover reaches the front (Web Audio, no file)
aria-labelstring"Cover flow"Names the carousel
classNamestringExtra class on the root

When to use

- Six to twenty visual items where looking at one at a time is the point – albums, places, products, case studies, templates - A showcase row that should feel physical: drag, flick, sideways trackpad scroll

When not to use

Interactive app UI; these are illustrations, so keep them out of task flows.

Related

Card stack