arrows

Previous/next navigation buttons. Auto-creates buttons inside the container, or uses existing elements.

Import

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

Usage

// Auto-create buttons
new Slider('#el', { plugins: [arrows()] })

// Use existing elements
new Slider('#el', {
  plugins: [
    arrows({
      prevEl: '#my-prev',
      nextEl: '#my-next',
      prevLabel: 'Previous',
      nextLabel: 'Next',
    }),
  ],
})

Options

OptionTypeDefaultDescription
prevElstring | HTMLElementSelector or element for the prev button. Auto-created if omitted.
nextElstring | HTMLElementSelector or element for the next button. Auto-created if omitted.
prevLabelstring'Previous slide'aria-label for the prev button.
nextLabelstring'Next slide'aria-label for the next button.

CSS classes

ClassApplied when
.c--slider-a__arrowAlways
.c--slider-a__arrow--prevPrev button
.c--slider-a__arrow--nextNext button
.c--slider-a__arrow--disabledAt first/last slide (non-loop)

Demo

View arrows demo →