A slideshow component for cycling through elements—images or slides of text—like a carousel.
Read the
official
Bootstrap Documentation for a full list of
instructions
and other options.
Add captions to your slides easily with the .carousel-caption
element within any
.carousel-item
. They can be easily hidden on smaller viewports, as shown below, with optional
display utilities. We hide them initially with
.d-none
and
bring them back on medium-sized devices with .d-md-block
.
<div id="carouselExample" class="carousel slide col-md-8 offset-md-2" data-bs-ride="carousel">
<div class="carousel-indicators">
<button type="button" data-bs-target="#carouselExample" data-bs-slide-to="0" class="active"></button>
<button type="button" data-bs-target="#carouselExample" data-bs-slide-to="1"></button>
<button type="button" data-bs-target="#carouselExample" data-bs-slide-to="2"></button>
</div>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="assets/img/elements/13.jpg" alt="First slide" />
<div class="carousel-caption d-none d-md-block">
<h3>First slide</h3>
<p>Eos mutat malis maluisset et, agam ancillae quo te, in vim congue pertinacia.</p>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="assets/img/elements/2.jpg" alt="Second slide" />
<div class="carousel-caption d-none d-md-block">
<h3>Second slide</h3>
<p>In numquam omittam sea.</p>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="assets/img/elements/18.jpg" alt="Third slide" />
<div class="carousel-caption d-none d-md-block">
<h3>Third slide</h3>
<p>Lorem ipsum dolor sit amet, virtute consequat ea qui, minim graeco mel no.</p>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExample" role="button" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExample" role="button" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</a>
</div>
Swiper is the most modern mobile touch slider with hardware accelerated transitions.
Usage
In order to use swiper on your page, It is required to include the following vendors css in the "Vendors CSS" area from the page's header:
<link rel="stylesheet" href="assets/vendor/libs/swiper/swiper.css" />
Include the following custom page level style in the "Page CSS" area from the page's header:
<link rel="stylesheet" href="assets/vendor/css/pages/ui-carousel.css" />
Include the following vendors script in the "Vendors JS" area from the page's footer:
<script src="assets/vendor/libs/swiper/swiper.js"></script>
Include the following custom script in the "Page JS" area from the page's footer:
<script src="assets/js/ui-carousel.js"></script>
Basic example
<div class="swiper text-white" id="swiper-default">
<div class="swiper-wrapper">
<div class="swiper-slide" style="background-image:url(assets/img/elements/1.jpg)">Slide 1</div>
<div class="swiper-slide" style="background-image:url(assets/img/elements/5.jpg)">Slide 2</div>
<div class="swiper-slide" style="background-image:url(assets/img/elements/12.jpg)">Slide 3</div>
<div class="swiper-slide" style="background-image:url(assets/img/elements/7.jpg)">Slide 4</div>
<div class="swiper-slide" style="background-image:url(assets/img/elements/11.jpg)">Slide 5</div>
</div>
</div>