Coverflow
Use indexProgress from the Reactive API to apply 3D rotation and scaling effects that create an album-art style coverflow interface.
- JavaScript
- React
- Vue@3
Summary
Key API
| Property | Type | Description |
|---|---|---|
indexProgress | number | Camera position as a fractional panel index |
useFlickingReactiveAPI | Hook (React) | Subscribe to reactive state in React |
connectFlickingReactiveAPI | Function (Vanilla) | Subscribe to reactive state in Vanilla JS |
Effect Mapping
| Panel Position | rotateY | scale | transformOrigin |
|---|---|---|---|
| Current (childProgress ~ 0) | 0deg | 0.9 | 50% 50% |
| Adjacent (childProgress ~ +/-1) | -/+50deg | 0.7 | shifted toward center |
| Far (childProgress ~ +/-2) | -/+100deg | 0.5 | shifted toward center |
Details
What is indexProgress?
indexProgress represents the current camera position as a fractional panel index. For example, 2.5 means the camera is exactly halfway between panel 2 and panel 3. It updates in real-time during drag, enabling smooth visual transitions.
How It Works
For circular mode, each panel's childProgress is calculated with wrapping:
const childProgress = (index - indexProgress + length * 1.5) % length - length * 0.5;
This value drives three CSS transform properties:
rotateY: Panels rotate around the Y-axis, angling away from centerscale: Panels shrink as they move further from centertransformOrigin: Shifts to create a natural perspective pivot point
Related Options
circular: true: Essential for seamless coverflow looping without dead ends.align: "center": Places the active panel at the visual center of the coverflow.
Use Cases
When to use
- Album / portfolio gallery
- Product showcase
- Media player UI
Important Notes
Note
- Set CSS
perspectiveon the viewport andtransform-style: preserve-3don the camera for 3D effects to render. - Use at least 5 panels to avoid gaps when using circular mode.
Related Links
Related API
indexProgress: Fractional panel index progressconnectFlickingReactiveAPI: Connect Flicking to Reactive API
Related Demos
- Parallax: Parallax scrolling effect using indexProgress
- Progress Bar: Scroll progress indicator