Carousels

Use the Bootstrap carousel components to show a collection of images in a slider

Example

Here’s an simple example of a carousel which only uses slides:

 <div id="Carousel1" class="carousel slide" data-ride="carousel">
    <div class="carousel-inner">
        <div class="carousel-item active">
            <img src="../../assets/img/carousel/image-1.jpg" class="d-block w-100" alt="slide1">
        </div>
        <div class="carousel-item">
            <img src="../../assets/img/carousel/image-2.jpg" class="d-block w-100" alt="slide2">
        </div>
        <div class="carousel-item">
            <img src="../../assets/img/carousel/image-3.jpg" class="d-block w-100" alt="slide3">
        </div>
    </div>
</div>

With controls

In this example you can see that there are two control items which you can click on to go the the previous or next item:

<div id="Carousel2" class="carousel slide" data-ride="carousel">
    <div class="carousel-inner">
        <div class="carousel-item active">
            <img class="d-block w-100" src="../../assets/img/carousel/image-1.jpg" alt="First slide">
        </div>
        <div class="carousel-item">
            <img class="d-block w-100" src="../../assets/img/carousel/image-2.jpg" alt="Second slide">
        </div>
        <div class="carousel-item">
            <img class="d-block w-100" src="../../assets/img/carousel/image-3.jpg" alt="Third slide">
        </div>
    </div>
    <a class="carousel-control-prev" href="#Carousel2" role="button" data-bs-slide="prev">
        <span class="carousel-control-prev-icon" aria-hidden="true"></span>
        <span class="sr-only">Previous</span>
    </a>
    <a class="carousel-control-next" href="#Carousel2" role="button" data-bs-slide="next">
        <span class="carousel-control-next-icon" aria-hidden="true"></span>
        <span class="sr-only">Next</span>
    </a>
</div>

With indicators

The following example is a carousel element with controls and indicators:

<div id="Carousel3" class="carousel slide" data-ride="carousel">
    <div class="carousel-indicators">
        <button type="button" data-bs-target="#Carousel3" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
        <button type="button" data-bs-target="#Carousel3" data-bs-slide-to="1" aria-label="Slide 2"></button>
        <button type="button" data-bs-target="#Carousel3" data-bs-slide-to="2" aria-label="Slide 3"></button>
    </div>
    <div class="carousel-inner">
        <div class="carousel-item active">
            <img class="d-block w-100" src="../../assets/img/carousel/image-1.jpg" alt="First slide">
        </div>
        <div class="carousel-item">
            <img class="d-block w-100" src="../../assets/img/carousel/image-2.jpg" alt="Second slide">
        </div>
        <div class="carousel-item">
            <img class="d-block w-100" src="../../assets/img/carousel/image-3.jpg" alt="Third slide">
        </div>
    </div>
    <a class="carousel-control-prev" href="#Carousel3" role="button" data-bs-slide="prev">
        <span class="carousel-control-prev-icon" aria-hidden="true"></span>
        <span class="sr-only">Previous</span>
    </a>
    <a class="carousel-control-next" href="#Carousel3" role="button" data-bs-slide="next">
        <span class="carousel-control-next-icon" aria-hidden="true"></span>
        <span class="sr-only">Next</span>
    </a>
</div>