Bootstrap 5 Carousel
The Bootstrap 5 carousel is a slideshow component for cycling through images, slides, or other content. It supports auto-play, keyboard navigation, touch/swipe on mobile, custom indicators, and captions. Bootstrap 5's carousel works without jQuery.
Primary Class
.carouselCommon Use Cases
- →Hero image slider
- →Testimonial carousel
- →Product image gallery
- →Team member showcase
- →Partner logo slideshow
- →Feature highlight rotation
Variants & Classes
| Variant | Description |
|---|---|
| Image carousel with controls | Standard sliding image carousel with prev/next buttons. |
| Carousel with indicators | Dot indicators showing current slide position. |
| Carousel with captions | Text overlay on each slide. |
| Auto-playing carousel | Slides advance automatically on a timer. |
| Fade transition | Fade instead of slide between items. |
Code Example
<div id="heroCarousel" class="carousel slide" data-bs-ride="carousel" data-bs-interval="5000">
<div class="carousel-indicators">
<button type="button" data-bs-target="#heroCarousel" data-bs-slide-to="0" class="active"></button>
<button type="button" data-bs-target="#heroCarousel" data-bs-slide-to="1"></button>
<button type="button" data-bs-target="#heroCarousel" data-bs-slide-to="2"></button>
</div>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="/slide1.jpg" class="d-block w-100" alt="Slide 1">
</div>
<div class="carousel-item">
<img src="/slide2.jpg" class="d-block w-100" alt="Slide 2">
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#heroCarousel" data-bs-slide="prev">
<span class="carousel-control-prev-icon"></span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#heroCarousel" data-bs-slide="next">
<span class="carousel-control-next-icon"></span>
</button>
</div>Canvas Framework Variants
The Canvas template extends Bootstrap 5 with 1,658+ component variants. Generate any of these using Canvas Builder:
- ✓Testimonial quote carousel with avatar
- ✓Multi-item visible carousel (show 3 cards)
- ✓Full-screen hero carousel with overlay text
- ✓Logo strip auto-scrolling carousel
- ✓Before/after image comparison slider
Best Practices
Use carousels sparingly on marketing pages
Studies consistently show image carousels on homepages hurt conversions — only the first slide gets significant attention. Use a carousel for testimonials or galleries where rotation adds value. Don't use it as your hero.
Always include alt text on carousel images
Each carousel-item image needs a meaningful alt attribute. Carousels are frequently built with empty alt text — this fails accessibility and loses SEO value from image indexing.
Test touch/swipe on real mobile devices
Bootstrap 5's carousel supports touch swipe natively. Test on iOS Safari and Android Chrome to verify swipe behaviour — particularly for multi-item carousels that may conflict with horizontal page scroll.