Arrows

Injects previous and next navigation buttons into the slider's outer wrapper. Buttons are automatically disabled at the first and last slide when loop and rewind are both off.

Import

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

Options

OptionTypeDefaultDescription
prevLabelstring'Previous slide'aria-label on the prev button.
nextLabelstring'Next slide'aria-label on the next button.

CSS classes

ClassApplied when
.sliderkit__arrowBoth buttons, always.
.sliderkit__arrow--prevPrevious button.
.sliderkit__arrow--nextNext button.
.sliderkit__arrow--disabledAt the first or last slide when loop:false and rewind:false.

Example

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

new Slider('#my-slider', {
  items: 1,
  loop:  true,
  plugins: [arrows()],
})

Custom button labels

arrows({
  prevLabel: 'Anterior',
  nextLabel: 'Siguiente',
})

See it live in the Base demo →