Rotating content displays with navigation controls
The simplest carousel with automatically sliding images.
<div class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">...</div>
<div class="carousel-item">...</div>
</div>
<button class="carousel-control-prev">...</button>
<button class="carousel-control-next">...</button>
</div>
data-bs-ride="carousel"
attribute starts auto-play. The first
.carousel-item
must have the
.active
class.
Add indicator dots to show the current slide and allow direct navigation.
<div class="carousel-indicators">
<button data-bs-slide-to="0" class="active"></button>
<button data-bs-slide-to="1"></button>
<button data-bs-slide-to="2"></button>
</div>
Add overlay text to your slides with
.carousel-caption
.
.d-none .d-md-block
to hide on small screens where text might be unreadable.
Change the default slide effect to a fade transition by adding
.carousel-fade
.
Carousels aren't just for images. Use them to showcase testimonials, reviews, or any content.
data-bs-ride="carousel"
data-bs-interval="5000"
Automatic by default
Left/right arrows
On mobile devices
ARIA included