Choosing the Right Pagination for Swiper: Bullets, Fraction, or Progress Bar
When building a Swiper carousel, choosing between bullets, fraction, or progress bar pagination can dramatically affect usability. This guide breaks down each option, compares trade‑offs, and shows a concrete implementation you can test right away.
10 Dec 2025, 19:50 UTC

Problem & Takeaway
When building a carousel with Swiper, the pagination style you pick can make or break the user experience. Bullets give clear navigation cues, fraction shows position numerically, and progress bar offers a visual sense of completion. The key is to match the style to your layout constraints, interactivity needs, and accessibility goals.
Decision Context
Decision to make: Which pagination type should you enable for your Swiper instance?
Constraints:
- Maximum horizontal space (e.g., mobile viewports or slidesPerView > 1)
- Need for direct slide navigation (clickable vs. non‑interactive indicator)
- Visual design requirements (color, size, animation)
- Accessibility compliance (ARIA roles, screen‑reader announcements)
- Version compatibility (Swiper 9.x and later)
Supported Options & Quick Comparison
| Pagination Type | Space Usage | Interactivity | Accessibility | Typical Use‑Case |
|---|---|---|---|---|
| Bullets | High (especially with many slides) | Clickable (if clickable:true) | Auto‑generated ARIA roles; screen readers announce each bullet as a button | When users need to jump to any slide quickly (e.g., image galleries) |
| Fraction | Low (single line of text) | No (non‑interactive) | Requires custom aria-label for screen readers | When you want to show progress without clutter (e.g., onboarding steps) |
| Progress Bar | Low (thin bar) | No (visual only) | May need additional text for screen readers; not announced automatically | When you want a subtle progress cue (e.g., long scrollable slides) |
Trade‑Off Analysis
- Bullets:
- Pros: Clear navigation, built‑in click handling, accessible out of the box.
- Cons: Can overflow on narrow screens; may consume too much space if
slidesPerViewis large. - Mitigation: Use
dynamicBullets:trueor setslidesPerView:1on mobile.
- Fraction:
- Pros: Minimal space, clean numeric indicator.
- Cons: No navigation, potential confusion if users expect clickable numbers.
- Mitigation: Combine with
clickable:truebullets or add a custom button.
- Progress Bar:
- Pros: Visual sense of completion, lightweight.
- Cons: Requires explicit height; not interactive; accessibility limited.
- Mitigation: Add
aria-labelor a hidden text node for screen readers.
Concrete Implementation Example
Below is a minimal Swiper instance that demonstrates all three pagination types side‑by‑side. This helps you verify which style best fits your design.
<!-- Swiper container -->
<div class="swiper-container" id="demo-swiper">
<div class="swiper-wrapper">
<div class="swiper-slide">Slide 1</div>
<div class="swiper-slide">Slide 2</div>
<div class="swiper-slide">Slide 3</div>
<div class="swiper-slide">Slide 4</div>
<div class="swiper-slide">Slide 5</div>
</div>
<!-- Pagination containers -->
<div class="swiper-pagination bullets"></div>
<div class="swiper-pagination fraction"></div>
<div class="swiper-pagination progressbar"></div>
</div>
JavaScript configuration (run in a browser console or a separate script tag):
const swiper = new Swiper('#demo-swiper', {
// Basic parameters
loop: true,
slidesPerView: 1,
navigation: false,
// Enable all three pagination types
pagination: {
el: '.swiper-pagination',
clickable: true,
dynamicBullets: true,
type: 'bullets', // default; overridden per container
},
});
// Override type per pagination element
swiper.params.pagination.el = '.bullets';
swiper.pagination.bulletsEl = document.querySelector('.bullets');
swiper.params.pagination.type = 'bullets';
swiper.pagination.update();
swiper.params.pagination.el = '.fraction';
swiper.pagination.fractionEl = document.querySelector('.fraction');
swiper.params.pagination.type = 'fraction';
swiper.pagination.update();
swiper.params.pagination.el = '.progressbar';
swiper.pagination.progressbarEl = document.querySelector('.progressbar');
swiper.params.pagination.type = 'progressbar';
swiper.pagination.update();
**Validation checklist**
- Open the page and confirm that each pagination container displays correctly.
- Resize the viewport: bullets should collapse or remain clickable; fraction stays readable; progress bar keeps its height.
- Inspect the DOM:
.swiper-pagination-bullet,.swiper-pagination-fraction, and.swiper-pagination-progressbarclasses should be present. - Use a screen reader: bullets announce as buttons, fraction should read “Slide 2 of 5” if you add
aria-label, progress bar may not be announced unless you add a hidden text node. - Check the console for any Swiper warnings about missing modules or invalid configuration.
Choosing the Best Fit
Apply the following quick filter:
- If you need users to jump to any slide, pick bullets (enable
clickable:true). - If screen real estate is tight and you only need to show position, pick fraction or progress bar.
- If you want a subtle visual cue without interaction, pick progress bar.
- For a hybrid approach, combine bullets with a progress bar to give both navigation and progress sense.
Remember that changing the pagination type after Swiper has initialized requires re‑initializing or updating the params.pagination.type and calling swiper.pagination.update() to reflect the new style. Always test on target devices and with assistive technologies to ensure accessibility compliance.
Limitations & Caveats
- Bullets can overflow on small screens if
slidesPerViewis large; consider responsive breakpoints. - Fraction pagination is not interactive; users cannot jump to a slide by tapping the number.
- Progress bar requires a non‑zero CSS height; otherwise it will not be visible.
- Custom CSS overrides can break default Swiper styles; use the
--swiper-pagination-colorvariable for color changes. - Changing pagination type after initialization requires re‑initialization or updating params and calling
swiper.pagination.update().
Conclusion
By evaluating your layout constraints, interaction needs, and accessibility goals against the trade‑offs listed above, you can confidently select the most appropriate Swiper pagination type. Use the example configuration to prototype quickly, validate across devices, and iterate until the pagination feels natural to your users.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.