Default
The most basic usage of Flicking. You can check the required HTML structure, CSS, and default option values.
- JavaScript
- React
- Vue@3
Summary
Default Option Values
When created without any options, the following defaults are applied:
| Option | Default | Description |
|---|---|---|
align | "center" | Panel alignment position |
horizontal | true | Horizontal movement |
circular | false | Circular mode disabled |
bound | false | No boundary restriction |
duration | 500 | Animation 500ms |
moveType | "snap" | Snap movement type |
Required Elements
| Element | Required | Description |
|---|---|---|
.flicking-viewport | Required | The viewport element to which the Flicking instance is attached |
.flicking-camera | Required | The container that holds the panels. The element that actually moves |
| Panel elements | Required | Direct children of .flicking-camera |
flicking.css | Required | Base stylesheet |
Details
HTML Structure
Flicking requires the following structure:
<div class="flicking-viewport">
<div class="flicking-camera">
<div class="panel">Panel 1</div>
<div class="panel">Panel 2</div>
<div class="panel">Panel 3</div>
</div>
</div>
- flicking-viewport: Defines the visible area.
overflow: hiddenis applied. - flicking-camera: Wraps the panels and moves during drag/animation.
- Panels: Each slide's content. Must be direct children of the camera.
CSS Import
You must import the Flicking CSS:
// JavaScript
import "@egjs/flicking/dist/flicking.css";
// React
import "@egjs/react-flicking/dist/flicking.css";
// Vue
import "@egjs/vue3-flicking/dist/flicking.css";
Notes
Required
If you do not import flicking.css, panels will not be positioned correctly. It contains the default styles for the viewport and camera.
Structure caution
Panel elements must be direct children of .flicking-camera. It will not work if there are other wrapper elements in between.
Related Links
Related Demos
- Alignment: Panel alignment options
- Circular: Circular mode
- Movement Types: Movement types