slideCounter

Overlay badge showing "2 / 5" in a corner of the slider. Useful for galleries.

Import

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

Usage

new Slider('#el', {
  plugins: [
    slideCounter({
      template: ({ current, total }) => `${current} / ${total}`,
    }),
  ],
})

Options

OptionTypeDefaultDescription
elstring | HTMLElementTarget element. Auto-created inside container if omitted.
template({ current, total }) => string'current / total'Custom format function.

Demo

View slide counter demo →