Plugins

Plugins extend the slider with UI features. Import only what you need from @andresclua/sliderkit-plugins.

Plugins live in a separate package — added as extras to each project

Frontend Maintained by Amaia, Diego Backend Maintained by Mara, Nerea

Just like the core, contributions are welcome — but only these maintainers have merge access. This keeps the plugin API consistent across projects.

Installation

pnpm add @andresclua/sliderkit-plugins

Usage

import { Slider } from '@andresclua/sliderkit'
import { arrows, pagination, autoplay } from '@andresclua/sliderkit-plugins'

new Slider('#el', {
  plugins: [
    arrows(),
    pagination({ type: 'dots' }),
    autoplay({ delay: 3000 }),
  ],
})

// Or register post-init:
slider.use(mouseWheel())

Available plugins

PluginImportDescription
arrowsarrows(opts?)Previous/next navigation buttons.
paginationpagination(opts?)Dots, fraction, progress, dynamic, or custom pagination.
autoplayautoplay(opts?)Automatic slide advancement with pause on hover/focus.
thumbnailsthumbnails(opts?)Clickable thumbnail strip synced with the slider.
progressBarprogressBar(opts?)Animated progress bar that fills as slides advance.
slideCounterslideCounter(opts?)Overlay badge showing "2 / 5" style counter.
mouseWheelmouseWheel(opts?)Navigate with the mouse wheel or trackpad scroll.
lazyLoadlazyLoad(opts?)IntersectionObserver-based image lazy loading.
parallaxparallax(opts?)CSS-based parallax effect on slide content.
autoHeightautoHeight(opts?)Animate the container height to match the active slide.
virtualSlidesvirtualSlides(opts?)Render only visible slides for huge datasets.
centerModecenterMode(opts?)Center the active slide with partial prev/next visible.
variableWidthvariableWidth(opts?)Allow slides with different widths.

Writing your own plugin

import type { SliderPlugin } from '@andresclua/sliderkit'

function myPlugin(): SliderPlugin {
  return {
    name: 'my-plugin',
    install(slider) {
      // slider is the full SliderInstance
      slider.on('afterSlideChange', ({ index }) => {
        console.log('slide changed to', index)
      })
    },
    destroy() {
      // cleanup
    },
  }
}