Perspective
Applies 3D perspective rotation and scale transformation effects based on panel position.
- JavaScript
- React
- Vue@3
Summary
Key Options
| Option | Type | Default | Description |
|---|---|---|---|
rotate | number | 1 | Rotation intensity. Positive values rotate right panels inward, negative values rotate outward |
scale | number | 2 | Scale transformation intensity |
perspective | number | 1000 | CSS perspective value (px). Smaller values produce stronger distortion |
Details
How It Works
The Perspective plugin automatically applies rotateY and scale transformations based on each panel's visible ratio. Panels closer to the center face forward, while panels farther away appear rotated.
Usage
import { Perspective } from "@egjs/flicking-plugins";
// Basic usage
flicking.addPlugins(new Perspective({ rotate: 1, perspective: 1000 }));
// Strong distortion
flicking.addPlugins(new Perspective({ rotate: -1, scale: 2, perspective: 600 }));
Notes
Caution
- Using with
circular: trueenables a seamless 3D rotation effect. - If there are too few panels, empty spaces may appear during circulation. At least 4-5 panels are recommended.