Pagination
Use currentPanelIndex, totalPanelCount, and moveTo from the Reactive API to build a dot pagination UI that stays in sync with the carousel.
- JavaScript
- React
- Vue@3
Summary
Key API
| Property / Method | Type | Description |
|---|---|---|
currentPanelIndex | number | Currently active panel index |
totalPanelCount | number | Total number of panels |
moveTo | (i: number) => Promise | Move to a specific panel |
Behavior
| State | Dot Style |
|---|---|
| Current panel | Active (highlighted) |
| Other panels | Default, click to navigate |
Details
How It Works
- Render dot buttons based on
totalPanelCount - Highlight the dot matching
currentPanelIndex - On dot click, call
moveTo(index)to navigate - When the user drags to a new panel,
currentPanelIndexupdates automatically and the dots re-sync
Related Options
align: "center": Center alignment makes pagination feel most intuitive.circular: true: In circular mode, dots cycle seamlessly as the first and last panels connect.
Use Cases
When to use
- Banner / hero slider position indicator
- Image gallery page indicator
- Mobile onboarding step dots
Related Links
Related API
currentPanelIndex: Active panel indexmoveTo: Navigate to panel
Related Demos
- Prev / Next: Previous/Next button navigation
- Progress Bar: Scroll progress indicator