Pagination
Adds page indicators to show the current panel position. Supports three types: bullet, fraction, and scroll.
- JavaScript
- React
- Vue@3
Summary
Key Options
| Option | Type | Default | Description |
|---|---|---|---|
type | "bullet" | "fraction" | "scroll" | "bullet" | Indicator display style |
parentEl | HTMLElement | - | Parent element for the indicator. By default, uses the .flicking-pagination element |
Required CSS
import "@egjs/flicking-plugins/dist/pagination.css";
Details
Behavior by Type
| Type | Description |
|---|---|
bullet | Displays dots corresponding to each panel. Click to move to that panel |
fraction | Displays numbers in current/total format (e.g., 1/5) |
scroll | Displays a scrollbar-style indicator |
HTML Structure
The pagination element must be placed inside the viewport.
<div class="flicking-viewport">
<div class="flicking-camera">
<!-- Panels -->
</div>
<div class="flicking-pagination"></div>
</div>
Framework-specific Usage
React — Use ViewportSlot:
<Flicking plugins={plugins}>
{/* Panels */}
<ViewportSlot>
<div className="flicking-pagination"></div>
</ViewportSlot>
</Flicking>
Vue — Use the #viewport slot:
<Flicking :plugins="plugins">
<!-- Panels -->
<template #viewport>
<div class="flicking-pagination"></div>
</template>
</Flicking>
Notes
Caution
- You must import
@egjs/flicking-plugins/dist/pagination.cssfor the indicator to display correctly. - With the
bullettype, having too many panels can result in too many dots. In that case, consider using thefractionorscrolltype.
Related Links
Related Demos
- Arrow: Arrow navigation
- Pagination (Reactive API): Custom pagination based on Reactive API