Cover Flow
betaA perspective stack of cards — the centre one large and in front, neighbours smaller, turned and dimmed — that springs to a new centre with ‹ › buttons or arrow keys.
- Display
- 1 file
- 1 npm package
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add cover-flownpm packages installed: class-variance-authority.
import { CoverFlow } from "@/components/ui/cover-flow";Default
Demo
Looping
<CoverFlow>
| Prop | Type | Default |
|---|---|---|
defaultIndexInitial active index when uncontrolled. Defaults to the middle card. | number | — |
hideControlsHide the ‹ › buttons. Arrow keys still work. | boolean | false |
indexControlled active index. | number | — |
itemClassNameClasses for every card's frame. | string | — |
labelThe carousel's accessible name. | string | "Gallery" |
loopWrap past the ends. | boolean | false |
onIndexChange | (index: number) => void | — |
size | "sm" | "md" | "lg" | "md" |
visibleHow many cards show on each side of the active one. | number | 2 |
Plus every attribute of <div> except defaultValue, onChange.
A focusable region with aria-roledescription="carousel" and a name (label, default "Gallery"). With focus on it, ArrowLeft and ArrowRight move between cards (swapped in right-to-left layouts, where the stack also mirrors), and Home and End jump to the ends. Each card is a group named "2 of 5"; the cards off-centre are aria-hidden and their contents inert, so focus cannot land on a half-hidden card. The Previous and Next buttons are named, mirror in RTL and disable at the ends unless `loop` is set. "Slide 2 of 5" is announced politely after each move. Under reduced motion the stack re-forms without animating.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes