Snippets Carousel

Bootstrap 5 E-commerce Product Page with Image Carousel

A single product page with an image carousel and thumbnail strip, price and savings, finish swatches, add-to-cart actions and a seller card.

Bootstrap 5 No jQuery Aug 2020 2.3K views

<section class="wdw-stage">
  <div class="container" style="max-width:1080px">
    <div class="wdw-card p-3 p-lg-4">
      <div class="row g-4 g-lg-5">
        <div class="col-lg-6">
          <div id="prodCarousel" class="carousel slide" data-bs-ride="false" aria-label="Product images">
            <div class="carousel-inner rounded-4 overflow-hidden"><div class="carousel-item active"><img src="https://images.unsplash.com/photo-1493663284031-b7e3aefcae8e?w=900&q=80" class="d-block w-100 prod-img" alt="Living room with a grey sofa and wooden table"></div><div class="carousel-item"><img src="https://images.unsplash.com/photo-1503602642458-232111445657?w=900&q=80" class="d-block w-100 prod-img" alt="Lounge chair beside a window"></div><div class="carousel-item"><img src="https://images.unsplash.com/photo-1540574163026-643ea20ade25?w=900&q=80" class="d-block w-100 prod-img" alt="Minimalist dining chairs"></div><div class="carousel-item"><img src="https://images.unsplash.com/photo-1555041469-a586c61ea9bc?w=900&q=80" class="d-block w-100 prod-img" alt="Modern sofa with cushions"></div><div class="carousel-item"><img src="https://images.unsplash.com/photo-1586023492125-27b2c045efd7?w=900&q=80" class="d-block w-100 prod-img" alt="Bright reading corner"></div></div>
            <button class="carousel-control-prev" type="button" data-bs-target="#prodCarousel" data-bs-slide="prev"><span class="prod-arrow"><span class="carousel-control-prev-icon" aria-hidden="true"></span></span><span class="visually-hidden">Previous</span></button>
            <button class="carousel-control-next" type="button" data-bs-target="#prodCarousel" data-bs-slide="next"><span class="prod-arrow"><span class="carousel-control-next-icon" aria-hidden="true"></span></span><span class="visually-hidden">Next</span></button>
          </div>
          <div class="d-flex gap-2 mt-3 overflow-auto pb-1" id="prodThumbs"><button type="button" class="prod-thumb active" data-bs-target="#prodCarousel" data-bs-slide-to="0" aria-label="Show image 1" aria-current="true"><img src="https://images.unsplash.com/photo-1493663284031-b7e3aefcae8e?w=160&q=80" alt="" width="72" height="72"></button><button type="button" class="prod-thumb" data-bs-target="#prodCarousel" data-bs-slide-to="1" aria-label="Show image 2"><img src="https://images.unsplash.com/photo-1503602642458-232111445657?w=160&q=80" alt="" width="72" height="72"></button><button type="button" class="prod-thumb" data-bs-target="#prodCarousel" data-bs-slide-to="2" aria-label="Show image 3"><img src="https://images.unsplash.com/photo-1540574163026-643ea20ade25?w=160&q=80" alt="" width="72" height="72"></button><button type="button" class="prod-thumb" data-bs-target="#prodCarousel" data-bs-slide-to="3" aria-label="Show image 4"><img src="https://images.unsplash.com/photo-1555041469-a586c61ea9bc?w=160&q=80" alt="" width="72" height="72"></button><button type="button" class="prod-thumb" data-bs-target="#prodCarousel" data-bs-slide-to="4" aria-label="Show image 5"><img src="https://images.unsplash.com/photo-1586023492125-27b2c045efd7?w=160&q=80" alt="" width="72" height="72"></button></div>
        </div>
        <div class="col-lg-6 d-flex flex-column">
          <div class="d-flex align-items-center gap-2 mb-2">
            <span class="badge bg-primary-subtle text-primary-emphasis rounded-pill">Bestseller</span>
            <span class="small wdw-muted"><span class="text-warning" aria-hidden="true">★★★★★</span> 5.0 · 230 reviews</span>
          </div>
          <h2 class="wdw-heading h2 mb-1">Ypperlig Lounge Collection</h2>
          <p class="wdw-muted mb-3">Designed in Stockholm with Hay</p>
          <div class="d-flex align-items-baseline gap-2 mb-3"><span class="fs-2 fw-bold" id="price">$3,444</span><s class="wdw-muted">$3,990</s><span class="badge text-bg-success rounded-pill">Save 14%</span></div>
          <p class="mb-4">High-strength clamps and joinery techniques give every piece a sturdy, creak-free build. Form and function at the same point, made for decades of use.</p>
          <fieldset class="mb-4">
            <legend class="small fw-semibold mb-2">Finish: <span id="finishName" class="fw-normal wdw-muted">Oak</span></legend>
            <div class="d-flex gap-2" role="radiogroup">
              <input type="radio" class="btn-check" name="finish" id="f1" value="Oak" checked><label class="prod-swatch" style="--sw:#c8a27a" for="f1"><span class="visually-hidden">Oak</span></label>
              <input type="radio" class="btn-check" name="finish" id="f2" value="Walnut"><label class="prod-swatch" style="--sw:#5b3d2a" for="f2"><span class="visually-hidden">Walnut</span></label>
              <input type="radio" class="btn-check" name="finish" id="f3" value="Ash grey"><label class="prod-swatch" style="--sw:#8c9199" for="f3"><span class="visually-hidden">Ash grey</span></label>
              <input type="radio" class="btn-check" name="finish" id="f4" value="Charcoal"><label class="prod-swatch" style="--sw:#2b2d33" for="f4"><span class="visually-hidden">Charcoal</span></label>
            </div>
          </fieldset>
          <div class="d-flex flex-wrap gap-2 mb-4">
            <button type="button" class="btn btn-primary rounded-pill px-4 flex-grow-1" id="addCart">Add to cart</button>
            <button type="button" class="btn btn-outline-primary rounded-pill px-4">Buy now</button>
            <button type="button" class="btn btn-outline-secondary rounded-circle p-0 prod-fav" style="width:44px" aria-pressed="false" aria-label="Save to wishlist"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1-1.1a5.5 5.5 0 0 0-7.8 7.8l1 1.1L12 21l7.8-7.5 1-1.1a5.5 5.5 0 0 0 0-7.8z"/></svg></button>
          </div>
          <ul class="list-unstyled small mb-4 row row-cols-1 row-cols-sm-2 g-2">
            <li class="col d-flex gap-2"><span class="text-primary">✓</span> Best in quality</li>
            <li class="col d-flex gap-2"><span class="text-primary">✓</span> Anti-creak joinery</li>
            <li class="col d-flex gap-2"><span class="text-primary">✓</span> Sturdy laminate surfaces</li>
            <li class="col d-flex gap-2"><span class="text-primary">✓</span> Easy-access storage</li>
          </ul>
          <div class="mt-auto d-flex align-items-center gap-3 p-3 rounded-4 bg-body-tertiary">
            <img src="https://i.pravatar.cc/90?img=15" class="rounded-circle" width="44" height="44" alt="">
            <div class="lh-sm flex-grow-1"><strong class="d-block">Rare Boutique</strong><span class="small wdw-muted">Ships from Sweden in 15-45 days</span></div>
            <a href="#" class="btn btn-sm btn-outline-primary rounded-pill">Visit</a>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="toast-container position-fixed bottom-0 end-0 p-3"><div id="cartToast" class="toast text-bg-dark" role="status" aria-live="polite" aria-atomic="true"><div class="toast-body">Added to your cart.</div></div></div>
</section>

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