Skip to content

Config

Available Props

PropDefaultDescription
enabledtrueControlled weather the carousel is enabled or disabled. 0.8.0
itemsToShow1Count of items to showed per view (can be a fraction).
itemsToScroll1Number of slides to be scrolled
wrapAroundfalseEnable infinite scrolling mode.
snapAlign'center'Controls the carousel position alignment, can be 'start', 'end', 'center-[odd|even]'
transition300Sliding transition time in ms.
autoplay0Auto play time in ms.
breakpointMode'viewport'Determines how the carousel breakpoints are calculated. acceptable values: 'viewport', 'carousel' 0.5.0
breakpointsnullAn object to pass all the breakpoints settings.
modelValue0Index number of the initial slide.
mouseDragtrueToggle mouse dragging
touchDragtrueToggle pointer touch dragging
pauseAutoplayOnHoverfalseToggle if auto play should pause on mouse hover
dir'ltr'Controls the carousel direction. Available values: 'ltr', 'rtl', 'ttb', 'btt' or use verbose 'left-to-right', 'right-to-left', 'top-to-bottom', 'bottom-to-top' 0.7.0
i18n{ ariaNextSlide: ...}Used to translate and/or change aria labels and additional texts used in the carousel. 0.3.1
gap0Used to add gap between the slides. 0.6.0
height'auto'Carousel track height. 0.7.0

Slots

Slides/Default

Used to render the carousel items. You can use either the default slot or wrap element in slides slot.

vue
<template>
  <Carousel>
    <template #slides>
      <Slide v-for="slide in 10" :key="slide">
        ...
      </Slide>
    </template>
  </Carousel>
</template>

Addons

Used to add display carousel addons components.

vue
<template>
  <Carousel>
    ...
    <template #addons>
      <Navigation />
      <Pagination />
    </template>
  </Carousel>
</template>

Slots Attributes

PropDescription
slideWidththe width of a single slide element. Rename to slideSize
slideSizethe width/height of a single slide element.
currentSlideindex number of the current slide.
slidesCountthe count of all slides

Example

vue
<template>
  <Carousel>
    <Slide v-for="slide in slides" :key="slide">
      <div class="carousel__item">{{ slide }}</div>
    </Slide>
  
    <template #addons="{ slidesCount }">
      <Navigation v-if="slidesCount > 1" />
    </template>
  </Carousel>
</template>

I18n

Available keys:

KeyDefaultsDescription
ariaNextSlide"Navigate to next slide"Sets title and aria-label for the “Next” navigation button.
ariaPreviousSlide"Navigate to previous slide"Sets title and aria-label for the “Previous” navigation button.
ariaNavigateToSlide"Navigate to slide {slideNumber}"Sets title and aria-label for pagination buttons to select a slide.
ariaGallery"Gallery"Used as the aria-label for the main carousel element, indicating purpose.
itemXofY"Item {currentSlide} of {slidesCount}"Provides screen readers with the current slide’s position in the sequence.
iconArrowUp"Arrow pointing upwards"Sets title and aria-label for the upward-pointing arrow SVG icon.
iconArrowDown"Arrow pointing downwards"Sets title and aria-label for the downward-pointing arrow SVG icon.
iconArrowRight"Arrow pointing to the right"Sets title and aria-label for the right-pointing arrow SVG icon.
iconArrowLeft"Arrow pointing to the left"Sets title and aria-label for the left-pointing arrow SVG icon.