Pagination

Three pagination modes: clickable dot bullets, a fraction counter (2 / 5), and a horizontal progress bar. Dots rebuild automatically when responsive breakpoints change the items count.

Import

import { pagination } from '@andresclua/sliderkit-plugins'

Options

OptionTypeDefaultDescription
type'dots' | 'fraction' | 'progress''dots'Pagination display style.
clickablebooleantrueClicking a dot navigates to that page. Only applies to dots type.
containerHTMLElement | string | nullouter wrapperWhere to append the pagination element. Defaults to the slider's outer wrapper.

CSS classes

ClassApplied when
.sliderkit__paginationThe pagination wrapper, always.
.sliderkit__pagination-bulletEach dot button (dots type).
.sliderkit__pagination-bullet--activeThe active dot.
.sliderkit__pagination-fractionAdded to wrapper for fraction type.
.sliderkit__pagination-progressProgress track (progress type).
.sliderkit__pagination-progress-fillProgress fill bar.

Dots

pagination({ type: 'dots', clickable: true })

One dot per page (not per slide). With items:3 and 9 slides you get 3 dots. Dots rebuild when the breakpoint changes.

Fraction

pagination({ type: 'fraction' })

Renders plain text: 2 / 5. Useful as an overlay on top of the slider.

Progress

pagination({ type: 'progress' })

A horizontal bar that fills as you advance through the slides.

Custom container

pagination({
  type: 'dots',
  container: '#my-pagination',  // mount outside the slider
})

See it live in the Base demo →