Supports v-model which determines the slide number.
Vue Property
Type
Description
color
String
One from Quasar Color Palette. It determines the color of the out of the box Carousel controls (arrows, quick nav).
arrows
Boolean
Show navigation arrows.
infinite
Boolean
Infinite slides scrolling.
autoplay
Boolean/Number
Auto scrolls between slides. Works great along infinite prop (but infinite is not required). If used as a number, it represents the number of milliseconds between scrolls.
quick-nav
Boolean
Shows navigational dots at bottom.
quick-nav-icon
String
Icon to use instead of the navigational dots at bottom.
no-swipe
Boolean
Disable navigation by touch/mouse actions.
handle-arrow-keys
Boolean
Allow navigation with left and right arrow key. In this case, it’s best to render only one such Carousel at a time.
easing
Function
Easing function used when changing slide from autoplay or button press.
swipe-easing
Function
Easing function used when changing slide with a swipe.
thumbnails
Array
(v0.15.11+) Array of thumbnails pointing to “statics” folder. Check examples.
thumbnails-horizontal
Boolean
(v0.15.11+) Thumbnails get displayed horizontally.
QCarousel Vue Methods
Vue Method
Description
next()
Goes to next slide.
previous()
Goes to previous slide.
goToSlide(slideNumber)
Go to the desired slide. slideNumber is 0-based.
QCarousel Vue Events
Vue Event
Description
@input(index)
Emits the index of the current slide.
@slide-trigger(oldIndex, newIndex, direction)
Emitted before animating to the new slide.
@slide(index, direction)
Emits the index of the current slide and the direction of the slide after the transition animation finishes. Emits even if navigating to the same slide.
@slide-direction('next'/'previous')
Emitted when navigating to a slide, describing direction (next / previous).
QCarouselSlide (Child)
Vue Property
Type
Description
img-src
String
An image from statics folder. Example: ‘statics/mountaings.png’.
QCarouselControl (Child)
Vue Property
Type
Description
position
String
Position of the control: ‘top’, ‘top-right’, ‘top-left’, ‘bottom-right’, etc
offset
Array of 2 Numbers
Offset on horizontal and vertical (in pixels). Example (default value): [18, 18].
Examples
Carousel with a base color, Arrows, Quick Navigation, and slides with images
Using v-model & some custom controls: autoplay button, progressbar, fullscreen toggle
Controlling from outside of Carousel: <q-btn rounded color="primary" @click="slide = 1" icon="arrow_downward" label="Navigate to second slide" class="q-ml-sm" />
<q-carousel v-model="slide" color="amber" quick-nav infinite :autoplay="autoplay" height="400px" > <q-carousel-slide v-for="n in 7":key="`car-${n}`" class="flex flex-center" :class="`bg-${colors[n % 5]}`" > <divclass="text-center"> <divclass="q-display-3">Slide {{ n }}</div> <div>Slides can contain any content.</div> </div> </q-carousel-slide>