Vue Bootstrap Carousel
Vue Carousel - Bootstrap 4 & Material Design
Note: This documentation is for an older version of Bootstrap (v.4). A
newer version is available for Bootstrap 5. We recommend migrating to the latest version of our product - Material Design for
Bootstrap 5.
Go to docs v.5
A slideshow component for cycling through elements—images or slides of text—like a carousel.
How it works
The carousel is a slideshow for cycling through a series of content, built with CSS 3D transforms and a bit of JavaScript. It works with a series of images, text, or custom markup. It also includes support for previous/next controls and indicators.
This documentation may contain syntax introduced in the MDB Vue 6.0.0 and can be incompatible with previous versions. See legacy docs.
Please be aware that nested carousels are not supported, and carousels are generally not compliant with accessibility standards.
Vue live preview Vue live preview (PRO)Example
Carousels don’t automatically normalize slide dimensions. As such, you may need to use additional utilities or custom styles to appropriately size content. While carousels support previous/next controls and indicators, they’re not explicitly required.
Slides only
<template>
<mdb-carousel :interval="8000">
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(68).webp" alt="First slide" />
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(6).webp" alt="Second slide" />
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(9).webp" alt="Third slide" />
</mdb-carousel>
</template>
<script>
import {
mdbCarousel,
mdbCarouselItem
} from 'mdbvue';
export default {
name: 'CarouselPage',
components: {
mdbCarousel,
mdbCarouselItem
}
}
</script>
With controls
Adding the previous and next controls:
<template>
<mdb-carousel :interval="8000" showControls>
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(68).webp" alt="First slide" />
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(6).webp" alt="Second slide" />
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(9).webp" alt="Third slide" />
</mdb-carousel>
</template>
<script>
import {
mdbCarousel,
mdbCarouselItem
} from 'mdbvue';
export default {
name: 'CarouselPage',
components: {
mdbCarousel,
mdbCarouselItem
}
}
</script>
With indicators
You can also add the indicators to the carousel, alongside the controls, too.
<template>
<mdb-carousel :interval="8000" showControls showIndicators>
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(68).webp" alt="First slide" />
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(6).webp" alt="Second slide" />
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(9).webp" alt="Third slide" />
</mdb-carousel>
</template>
<script>
import {
mdbCarousel,
mdbCarouselItem
} from 'mdbvue';
export default {
name: 'CarouselPage',
components: {
mdbCarousel,
mdbCarouselItem
}
}
</script>
With captions
Add captions to your slides easily with the mdb-carousel-caption
component within
any
mdb-carousel-item
.
<template>
<mdb-carousel :interval="8000" showControls showIndicators>
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(68).webp" mask="black-light"
alt="First slide">
<mdb-carousel-caption title="Light mask" text="First text"></mdb-carousel-caption>
</mdb-carousel-item>
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(6).webp" mask="black-strong"
alt="Second slide">
<mdb-carousel-caption title="Strong mask" text="Second text"></mdb-carousel-caption>
</mdb-carousel-item>
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(9).webp" mask="black-slight"
alt="Third slide">
<mdb-carousel-caption title="Super light mask" text="Third text"></mdb-carousel-caption>
</mdb-carousel-item>
</mdb-carousel>
</template>
<script>
import {
mdbCarousel,
mdbCarouselItem,
mdbCarouselCaption
} from 'mdbvue';
export default {
name: 'CarouselPage',
components: {
mdbCarousel,
mdbCarouselItem,
mdbCarouselCaption
}
}
</script>
Crossfade
Fade effect is added as a default in Vue Carousel.
<template>
<mdb-carousel :interval="8000" showControls showIndicators>
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(68).webp" mask="black-light"
alt="First slide">
</mdb-carousel-item>
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(6).webp" mask="black-strong"
alt="Second slide">
</mdb-carousel-item>
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(9).webp" mask="black-slight"
alt="Third slide">
</mdb-carousel-item>
</mdb-carousel>
</template>
<script>
import {
mdbCarousel,
mdbCarouselItem,
mdbCarouselCaption
} from 'mdbvue';
export default {
name: 'CarouselPage',
components: {
mdbCarousel,
mdbCarouselItem,
mdbCarouselCaption
}
}
</script>
Multi-item carousel MDB Pro component
Multi-item carousel component consists of two template tags - one with 'v-slot:mobile' for a mobile view layout, and the second for a desktop view.
<template>
<mdb-container class="mt-5">
<mdb-multi-carousel :interval="8000" showControls showIndicators slide>
<template>
<mdb-carousel-item>
<mdb-row class="carousel__item">
<mdb-col md="4">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(34).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-col>
<mdb-col md="4" class="clearfix d-none d-md-block">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(18).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-col>
<mdb-col md="4" class="clearfix d-none d-md-block">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(35).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-col>
</mdb-row>
</mdb-carousel-item>
<mdb-carousel-item>
<mdb-row class="carousel__item">
<mdb-col md="4">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(60).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-col>
<mdb-col md="4" class="clearfix d-none d-md-block">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(47).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-col>
<mdb-col md="4" class="clearfix d-none d-md-block">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(48).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-col>
</mdb-row>
</mdb-carousel-item>
<mdb-carousel-item>
<mdb-row class="carousel__item">
<mdb-col md="4">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(53).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-col>
<mdb-col md="4" class="clearfix d-none d-md-block">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(45).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-col>
<mdb-col md="4" class="clearfix d-none d-md-block">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(51).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-col>
</mdb-row>
</mdb-carousel-item>
</template>
<template v-slot:mobile>
<mdb-carousel-item class="carousel__item">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(34).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-carousel-item>
<mdb-carousel-item class="carousel__item">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(18).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-carousel-item>
<mdb-carousel-item class="carousel__item">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(35).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-carousel-item>
<mdb-carousel-item class="carousel__item">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(60).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-carousel-item>
<mdb-carousel-item class="carousel__item">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(47).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-carousel-item>
<mdb-carousel-item class="carousel__item">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(48).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-carousel-item>
<mdb-carousel-item class="carousel__item">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(53).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-carousel-item>
<mdb-carousel-item class="carousel__item">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(45).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-carousel-item>
<mdb-carousel-item class="carousel__item">
<mdb-card class="mb-2">
<mdb-card-image src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(51).webp"
alt="Card image cap" waves></mdb-card-image>
<mdb-card-body>
<mdb-card-title>Card title</mdb-card-title>
<mdb-card-text>Some quick example text to build on the card title and make up the bulk of the
card's content.</mdb-card-text>
<mdb-btn color="primary">Button</mdb-btn>
</mdb-card-body>
</mdb-card>
</mdb-carousel-item>
</template>
</mdb-multi-carousel>
</mdb-container>
</template>
<script>
import {
mdbMultiCarousel,
mdbCarouselItem,
mdbContainer,
mdbRow,
mdbCol,
mdbCard,
mdbCardImage,
mdbCardBody,
mdbCardTitle,
mdbCardText,
mdbBtn
} from 'mdbvue';
export default {
name: 'CarouselPage',
components: {
mdbMultiCarousel,
mdbCarouselItem,
mdbContainer,
mdbRow,
mdbCol,
mdbCard,
mdbCardImage,
mdbCardBody,
mdbCardTitle,
mdbCardText,
mdbBtn
}
}
</script>
<style scoped>
.carousel__item {
padding: 10px;
}
</style>
Carousel with lightbox MDB Pro component
Easy combination carousel with lightbox gallery!
<template>
<mdb-container>
<mdb-carousel :interval="8000" showControls showIndicators multi slide top navClass="btn-secondary"
indicatorClass="secondary-color">
<mdb-carousel-item>
<mdb-row class="mdb-lightbox px-2">
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox(0)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(2).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox(1)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(3).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox(2)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(4).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox(3)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(5).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox(4)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(6).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox(5)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(7).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
</mdb-row>
</mdb-carousel-item>
<mdb-carousel-item>
<mdb-row class="mdb-lightbox px-2">
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox2(0)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(8).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox2(1)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(9).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox2(2)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(10).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox2(3)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(11).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox2(4)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(12).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox2(5)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(13).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
</mdb-row>
</mdb-carousel-item>
<mdb-carousel-item>
<mdb-row class="mdb-lightbox px-2">
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox3(0)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(14).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox3(1)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(15).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox3(2)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(16).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox3(3)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(17).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox3(4)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(18).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
<mdb-col md="4" class="d-md-inline-block" @click.native="showLightbox3(5)">
<figure>
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(19).webp"
class="img-fluid" alt="" />
</figure>
</mdb-col>
</mdb-row>
</mdb-carousel-item>
</mdb-carousel>
<mdb-lightbox :visible="visible" :imgs="imgs" :index="index" @hide="handleHide"></mdb-lightbox>
<mdb-lightbox :visible="visible2" :imgs="imgs2" :index="index2" @hide="handleHide2"></mdb-lightbox>
<mdb-lightbox :visible="visible3" :imgs="imgs3" :index="index3" @hide="handleHide3"></mdb-lightbox>
</mdb-container>
</template>
<script>
import {
mdbCarousel,
mdbCarouselItem,
mdbCarouselCaption,
mdbRow,
mdbIcon,
mdbContainer,
mdbCol,
mdbLightbox
} from 'mdbvue';
export default {
name: 'CarouselProPage',
components: {
mdbCarousel,
mdbCarouselItem,
mdbCarouselCaption,
mdbRow,
mdbIcon,
mdbContainer,
mdbCol,
mdbLightbox
},
data() {
return {
imgs: [
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(2).webp',
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(3).webp',
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(4).webp',
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(5).webp',
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(6).webp',
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(7).webp'
],
imgs2: [
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(8).webp',
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(9).webp',
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(10).webp',
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(11).webp',
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(12).webp',
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(13).webp'
],
imgs3: [
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(14).webp',
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(15).webp',
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(16).webp',
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(17).webp',
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(18).webp',
'https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(19).webp'
],
visible: false,
visible2: false,
visible3: false,
index: 0,
index2: 0,
index3: 0,
};
},
methods: {
showLightbox(index) {
this.index = index;
this.visible = true;
},
showLightbox2(index2) {
this.index2 = index2;
this.visible2 = true;
},
showLightbox3(index3) {
this.index3 = index3;
this.visible3 = true;
},
handleHide() {
this.visible = false;
},
handleHide2() {
this.visible2 = false;
},
handleHide3() {
this.visible3 = false;
}
}
}
</script>
Thumbnails carousel MDB Pro component
A simple bootstrap slider with arrows and thumbnails as controls.
<template>
<mdb-carousel :interval="8000" showControls showIndicators thumbnails>
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(88).webp"
thumbnail="https://mdbootstrap.com/img/Photos/Others/Carousel-thumbs/img%20(88).webp" alt="First slide">
</mdb-carousel-item>
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(121).webp"
thumbnail="https://mdbootstrap.com/img/Photos/Others/Carousel-thumbs/img%20(121).webp" alt="Second slide">
</mdb-carousel-item>
<mdb-carousel-item img src="https://mdbootstrap.com/img/Photos/Slides/img%20(31).webp"
thumbnail="https://mdbootstrap.com/img/Photos/Others/Carousel-thumbs/img%20(31).webp" alt="Third slide">
</mdb-carousel-item>
</mdb-carousel>
</template>
<script>
import {
mdbCarousel,
mdbCarouselItem,
mdbCarouselCaption
} from 'mdbvue';
export default {
name: 'ThumbnailsCarouselPage',
components: {
mdbCarousel,
mdbCarouselItem,
mdbCarouselCaption
}
}
</script>
Video carousel
Replace img elements with video elements to create a video carousel.
<template>
<mdb-carousel :interval="8000" showControls showIndicators>
<mdb-carousel-item video src="https://mdbootstrap.com/img/video/Tropical.mp4" alt="First slide" auto loop>
</mdb-carousel-item>
<mdb-carousel-item video src="https://mdbootstrap.com/img/video/forest.mp4" alt="Second slide" auto loop>
</mdb-carousel-item>
<mdb-carousel-item video src="https://mdbootstrap.com/img/video/Agua-natural.mp4" alt="Third slide" auto loop>
</mdb-carousel-item>
</mdb-carousel>
</template>
<script>
import {
mdbCarousel,
mdbCarouselItem
} from 'mdbvue';
export default {
name: 'VideoCarouselPage',
components: {
mdbCarousel,
mdbCarouselItem
}
}
</script>
Full page carousels
Click the buttons below to see a live preview.
Vue Carousel - API
In this section you will find advanced information about the Carousel component. You will learn which modules are required in this component, what are the possibilities of configuring the component, and what events and methods you can use in working with it.
Import statement
<script>
import { mdbCarousel, mdbCarouselItem, mdbCarouselCaption } from 'mdbvue';
</script>
API Reference: Properties
Name | Type | Default | Description | Example |
---|---|---|---|---|
indicatorClass |
String | false |
Adding custom classes to indicators. | <mdb-carousel indicatorClass="..."> |
interval |
Number | 10000 |
Defines the interval of slide animation (in seconds). | <mdb-carousel :interval="5000"> |
multi |
Boolean | false |
Changes basic carousel into multi-item carousel. | <mdb-carousel multi> |
navClass |
String | false |
Adding custom classes to navigation controls. | <mdb-carousel navClass="..."> |
showControls |
Boolean | false |
Adding the previous and next controls. | <mdb-carousel showControls> |
showIndicators |
Boolean | false |
Adding indicators. | <mdb-carousel showIndicators> |
slide |
Boolean | false |
Changes fade animation effect into slide. | <mdb-carousel slide> |
thumbnails |
Boolean | false |
Changes basic carousel into thumbnails carousel. | <mdb-carousel thumbnails> |
top |
Boolean | false |
Showing controls above the carousel inner. | <mdb-carousel top> |
touch |
Boolean | false |
Add mobile touch events to carousel. | <mdb-carousel touch> |
Multi-item Carousel - API
In this section you will find advanced information about the Multi-item Carousel component. You will learn which modules are required in this component, what are the possibilities of configuring the component, and what events and methods you can use in working with it.
Import statement
<script>
import { mdbMultiCarousel } from 'mdbvue';
</script>
API Reference: Properties
Name | Type | Default | Description | Example |
---|---|---|---|---|
indicatorClass |
String | false |
Adding custom classes to indicators. | <mdb-carousel indicatorClass="..."> |
interval |
Number | 10000 |
Defines the interval of slide animation (in seconds). | <mdb-carousel :interval="5000"> |
navClass |
String | false |
Adding custom classes to navigation controls. | <mdb-carousel navClass="..."> |
showControls |
Boolean | false |
Adding the previous and next controls. | <mdb-carousel showControls> |
showIndicators |
Boolean | false |
Adding indicators. | <mdb-carousel showIndicators> |
slide |
Boolean | false |
Changes fade animation effect into slide. | <mdb-carousel slide> |
touch |
Boolean | false |
Add mobile touch events to carousel. | <mdb-carousel touch> |