Snippets Carousel

Bootstrap 5 Product Page with Image Carousel

A single product page with an image carousel and thumbnail strip, price and offers, storage options, delivery info and add-to-cart actions.

Bootstrap 5 No jQuery Jun 2020 4.2K views

<section class="wdw-stage pd-stage">
  <div class="container pd-container">
    <div class="wdw-card overflow-hidden">
      <div class="row g-0">
        <div class="col-lg-6">
          <div class="pd-media h-100 p-3 p-md-4">
            <div id="pdCarousel" class="carousel slide rounded-4 overflow-hidden" data-bs-ride="false" role="group" aria-roledescription="carousel" aria-label="Product photos">
              <div class="carousel-inner"><div class="carousel-item active"><img src="https://images.unsplash.com/photo-1496181133206-80ce9b88a853?w=1000&q=80&fm=jpg" class="d-block w-100" alt="Silver laptop open on a light wooden desk"></div><div class="carousel-item"><img src="https://images.unsplash.com/photo-1541807084-5c52b6b3adef?w=1000&q=80&fm=jpg" class="d-block w-100" alt="Slim laptop showing a landscape wallpaper on a wooden table" loading="lazy"></div><div class="carousel-item"><img src="https://images.unsplash.com/photo-1611186871348-b1ce696e52c9?w=1000&q=80&fm=jpg" class="d-block w-100" alt="Back lid of a silver laptop on a grey surface" loading="lazy"></div><div class="carousel-item"><img src="https://images.unsplash.com/photo-1593642632823-8f785ba67e45?w=1000&q=80&fm=jpg" class="d-block w-100" alt="Laptop screen with colourful abstract artwork" loading="lazy"></div></div>
              <button class="carousel-control-prev" type="button" data-bs-target="#pdCarousel" data-bs-slide="prev" aria-label="Previous photo"><span class="pd-arrow"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg></span><span class="visually-hidden">Previous</span></button>
              <button class="carousel-control-next" type="button" data-bs-target="#pdCarousel" data-bs-slide="next" aria-label="Next photo"><span class="pd-arrow"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></span><span class="visually-hidden">Next</span></button>
            </div>
            <div class="pd-thumbs d-flex gap-2 mt-3"><button type="button" data-bs-target="#pdCarousel" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Show photo 1: laptop open on a wooden desk"><img src="https://images.unsplash.com/photo-1496181133206-80ce9b88a853?w=160&h=160&fit=crop&q=70&fm=jpg" alt=""></button><button type="button" data-bs-target="#pdCarousel" data-bs-slide-to="1" aria-label="Show photo 2: laptop on a table with landscape wallpaper"><img src="https://images.unsplash.com/photo-1541807084-5c52b6b3adef?w=160&h=160&fit=crop&q=70&fm=jpg" alt=""></button><button type="button" data-bs-target="#pdCarousel" data-bs-slide-to="2" aria-label="Show photo 3: back lid of the laptop"><img src="https://images.unsplash.com/photo-1611186871348-b1ce696e52c9?w=160&h=160&fit=crop&q=70&fm=jpg" alt=""></button><button type="button" data-bs-target="#pdCarousel" data-bs-slide-to="3" aria-label="Show photo 4: screen with colourful abstract artwork"><img src="https://images.unsplash.com/photo-1593642632823-8f785ba67e45?w=160&h=160&fit=crop&q=70&fm=jpg" alt=""></button></div>
          </div>
        </div>
        <div class="col-lg-6">
          <div class="p-4 p-lg-4 p-xl-5">
            <span class="wdw-eyebrow">Laptops</span>
            <h2 class="wdw-heading h4 mt-1 mb-2">Aero Air 13 · 8GB RAM / 256GB SSD</h2>
            <div class="d-flex align-items-center gap-2 small mb-3">
              <span class="pd-stars" role="img" aria-label="Rated 4.7 out of 5"><span class="pd-stars-bg"><svg width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.9L12 17.8 5.8 21.1 7 14.2 2 9.3l6.9-1z"/></svg><svg width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.9L12 17.8 5.8 21.1 7 14.2 2 9.3l6.9-1z"/></svg><svg width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.9L12 17.8 5.8 21.1 7 14.2 2 9.3l6.9-1z"/></svg><svg width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.9L12 17.8 5.8 21.1 7 14.2 2 9.3l6.9-1z"/></svg><svg width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.9L12 17.8 5.8 21.1 7 14.2 2 9.3l6.9-1z"/></svg></span><span class="pd-stars-fg" style="width:94%"><span><svg width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.9L12 17.8 5.8 21.1 7 14.2 2 9.3l6.9-1z"/></svg><svg width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.9L12 17.8 5.8 21.1 7 14.2 2 9.3l6.9-1z"/></svg><svg width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.9L12 17.8 5.8 21.1 7 14.2 2 9.3l6.9-1z"/></svg><svg width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.9L12 17.8 5.8 21.1 7 14.2 2 9.3l6.9-1z"/></svg><svg width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.9L12 17.8 5.8 21.1 7 14.2 2 9.3l6.9-1z"/></svg></span></span></span>
              <span class="fw-semibold" aria-hidden="true">4.7</span><span class="wdw-muted">1,200 ratings · 564 reviews</span>
            </div>
            <div class="d-flex align-items-baseline flex-wrap gap-2 mb-3">
              <span class="fs-1 fw-bold text-body-emphasis" id="pdPrice" aria-live="polite">$749</span>
              <s class="wdw-muted" id="pdList"><span class="visually-hidden">Original price </span>$999</s>
              <span class="badge rounded-pill bg-success-subtle text-success-emphasis" id="pdOff">25% off</span>
            </div>
            <ul class="list-unstyled d-grid gap-2 mb-3 p-3 rounded-4 bg-body-tertiary"><li class="d-flex flex-column flex-sm-row gap-1 gap-sm-2 small"><span class="badge rounded-pill bg-primary-subtle text-primary-emphasis align-self-start flex-none pd-tag">Credit card</span><span class="text-body-secondary">20% instant discount on SBI credit cards</span></li><li class="d-flex flex-column flex-sm-row gap-1 gap-sm-2 small"><span class="badge rounded-pill bg-primary-subtle text-primary-emphasis align-self-start flex-none pd-tag">Cashback</span><span class="text-body-secondary">5% unlimited cashback on Axis Bank credit card</span></li><li class="d-flex flex-column flex-sm-row gap-1 gap-sm-2 small"><span class="badge rounded-pill bg-primary-subtle text-primary-emphasis align-self-start flex-none pd-tag">Bank offer</span><span class="text-body-secondary">Extra 5% off with Axis Bank Buzz credit card</span></li><li class="d-flex flex-column flex-sm-row gap-1 gap-sm-2 small"><span class="badge rounded-pill bg-primary-subtle text-primary-emphasis align-self-start flex-none pd-tag">Wallet</span><span class="text-body-secondary">20% instant discount when paying with Google Wallet</span></li></ul>
            <div class="d-flex align-items-center gap-2 small mb-3">
              <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" class="text-primary" aria-hidden="true"><rect x="1" y="6" width="14" height="11" rx="1"/><path d="M15 9h4l3 3v5h-7"/><circle cx="6" cy="18" r="2"/><circle cx="18" cy="18" r="2"/></svg>
              <span>Delivery by <strong>Tuesday, 23 Jul</strong></span><span class="badge rounded-pill bg-success-subtle text-success-emphasis">Free</span>
            </div>
            <fieldset class="mb-3">
              <legend class="fs-6 fw-semibold mb-2">Storage</legend>
              <div class="d-flex flex-wrap gap-2"><input type="radio" class="btn-check" name="pdStorage" id="pdS128" value="128" checked><label class="btn btn-outline-secondary pd-opt rounded-pill" for="pdS128">128 GB</label><input type="radio" class="btn-check" name="pdStorage" id="pdS256" value="256"><label class="btn btn-outline-secondary pd-opt rounded-pill" for="pdS256">256 GB</label><input type="radio" class="btn-check" name="pdStorage" id="pdS512" value="512"><label class="btn btn-outline-secondary pd-opt rounded-pill" for="pdS512">512 GB</label></div>
            </fieldset>
            <div class="small wdw-muted mb-4">Seller: <span class="fw-semibold text-body">Sargam Electronics</span></div>
            <div class="d-flex flex-wrap gap-2">
              <button type="button" class="btn btn-outline-primary rounded-pill px-4 flex-grow-1" id="pdAdd">Add to cart</button>
              <button type="button" class="btn btn-primary rounded-pill px-4 flex-grow-1">Buy now</button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>

Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.