Multi item carousel
Bootstrap 5 Multi item carousel plugin
An advanced slideshow component for cycling through images with a selectable number of active
items.
Responsive Multi item carousel built with the latest Bootstrap 5. Many practical examples like lightbox integration, Vertical, autoplay, and many more.
Note: Read the API tab to find all available options and
advanced customization
Basic example
A basic example of a multi carousel with the most common use case with 3 active items (default
version).
<div class="multi-carousel">
<div class="multi-carousel-inner">
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/1.webp"
alt="Gallery image 1"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/2.webp"
alt="Gallery image 2"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/3.webp"
alt="Gallery image 3"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/4.webp"
alt="Gallery image 4"
class="w-100"
/>
</div>
</div>
<button
class="carousel-control-prev"
type="button"
tabindex="0"
data-mdb-slide="prev"
>
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
</button>
<button
class="carousel-control-next"
type="button"
tabindex="0"
data-mdb-slide="next"
>
<span class="carousel-control-next-icon" aria-hidden="true"></span>
</button>
</div>
Vertical example
To enable vertical mode just add vertical
class to the wrapper element.
<div class="multi-carousel vertical" style="max-width: 20rem;">
<div class="multi-carousel-inner">
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/1.webp"
alt="Gallery image 1"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/2.webp"
alt="Gallery image 2"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/3.webp"
alt="Gallery image 3"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/4.webp"
alt="Gallery image 4"
class="w-100"
/>
</div>
</div>
<button
class="carousel-control-prev"
type="button"
tabindex="0"
data-mdb-slide="prev"
>
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
</button>
<button
class="carousel-control-next"
type="button"
tabindex="0"
data-mdb-slide="next"
>
<span class="carousel-control-next-icon" aria-hidden="true"></span>
</button>
</div>
Lightbox integration
Wrap carousel by a div.lightbox
element to enable lightbox.
To ensure the proper performance of the page, it is recommended to include thumbnails of
images in the src attribute. Then in the
data-mdb-img
attribute add the path to the image with higher resolution. If the
data-mdb-img
attribute is omitted, the lightbox will display the same image as in
the reduced size.
<div class="lightbox">
<div class="multi-carousel">
<div class="multi-carousel-inner">
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/1.webp"
data-mdb-img="https://mdbootstrap.com/img/Photos/Slides/1.webp"
alt="Gallery image 1"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/2.webp"
data-mdb-img="https://mdbootstrap.com/img/Photos/Slides/2.webp"
alt="Gallery image 2"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/3.webp"
data-mdb-img="https://mdbootstrap.com/img/Photos/Slides/3.webp"
alt="Gallery image 3"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/4.webp"
data-mdb-img="https://mdbootstrap.com/img/Photos/Slides/4.webp"
alt="Gallery image 4"
class="w-100"
/>
</div>
</div>
<button
class="carousel-control-prev"
type="button"
tabindex="0"
data-mdb-slide="prev"
>
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
</button>
<button
class="carousel-control-next"
type="button"
tabindex="0"
data-mdb-slide="next"
>
<span class="carousel-control-next-icon" aria-hidden="true"></span>
</button>
</div>
</div>
Active items
Set a data-mdb-items
attribute to change the number of active images.
<div class="multi-carousel" data-mdb-items="2">
<div class="multi-carousel-inner">
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/1.webp"
data-mdb-img="https://mdbootstrap.com/img/Photos/Slides/1.webp"
alt="Gallery image 1"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/2.webp"
data-mdb-img="https://mdbootstrap.com/img/Photos/Slides/2.webp"
alt="Gallery image 2"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/3.webp"
data-mdb-img="https://mdbootstrap.com/img/Photos/Slides/3.webp"
alt="Gallery image 3"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/4.webp"
data-mdb-img="https://mdbootstrap.com/img/Photos/Slides/4.webp"
alt="Gallery image 4"
class="w-100"
/>
</div>
</div>
<button
class="carousel-control-prev"
type="button"
tabindex="0"
data-mdb-slide="prev"
>
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
</button>
<button
class="carousel-control-next"
type="button"
tabindex="0"
data-mdb-slide="next"
>
<span class="carousel-control-next-icon" aria-hidden="true"></span>
</button>
</div>
Breakpoint
To change breakpoint on small devices easily set
data-mdb-breakpoint
value (default value is 992). Set to false
to
disable responsiveness.
<div class="multi-carousel" data-mdb-breakpoint="1200">
<div class="multi-carousel-inner">
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/1.webp"
alt="Gallery image 1"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/2.webp"
alt="Gallery image 2"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/3.webp"
alt="Gallery image 3"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/4.webp"
alt="Gallery image 4"
class="w-100"
/>
</div>
</div>
<button
class="carousel-control-prev"
type="button"
tabindex="0"
data-mdb-slide="prev"
>
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
</button>
<button
class="carousel-control-next"
type="button"
tabindex="0"
data-mdb-slide="next"
>
<span class="carousel-control-next-icon" aria-hidden="true"></span>
</button>
</div>
Autoplay
Set a data-mdb-interval
attribute to enable autoplay.
<div class="multi-carousel" data-mdb-interval="2000">
<div class="multi-carousel-inner">
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/1.webp"
alt="Gallery image 1"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/2.webp"
alt="Gallery image 2"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/3.webp"
alt="Gallery image 3"
class="w-100"
/>
</div>
<div class="multi-carousel-item">
<img
src="https://mdbootstrap.com/img/Photos/Thumbnails/Slides/4.webp"
alt="Gallery image 4"
class="w-100"
/>
</div>
</div>
<button
class="carousel-control-prev"
type="button"
tabindex="0"
data-mdb-slide="prev"
>
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
</button>
<button
class="carousel-control-next"
type="button"
tabindex="0"
data-mdb-slide="next"
>
<span class="carousel-control-next-icon" aria-hidden="true"></span>
</button>
</div>