Snippets Buttons

Bootstrap 5 Product Page Carousel with Size Selector

A product detail card with a two-product carousel, size picker that updates the price, wishlist toggle, star rating and add-to-cart button.

Bootstrap 5 No jQuery Jun 2020 2.5K views

<section class="wdw-stage">
  <div class="container" style="max-width:960px">
    <div id="pdpCarousel" class="carousel slide wdw-card overflow-hidden" data-bs-ride="false" aria-roledescription="carousel" aria-label="Featured products">
      <div class="carousel-inner">
        <div class="carousel-item active">
          <div class="row g-0 align-items-stretch">
            <div class="col-md-5"><img class="pdp-img" src="https://images.unsplash.com/photo-1556228720-195a672e8a03?auto=format&fit=crop&w=800&q=80" alt="Herbalism Cleanser tube on a neutral background" loading="lazy"></div>
            <div class="col-md-7 p-4 p-lg-5 d-flex flex-column">
              <nav aria-label="breadcrumb"><ol class="breadcrumb small mb-3"><li class="breadcrumb-item"><a href="#">Home</a></li><li class="breadcrumb-item"><a href="#">Skincare</a></li><li class="breadcrumb-item active" aria-current="page">Cleansers</li></ol></nav>
              <div class="d-flex justify-content-between align-items-start gap-3">
                <div><h2 class="wdw-heading h2 mb-1">Herbalism Cleanser</h2><p class="wdw-muted mb-2">Natural herbal face wash with chamomile and oat</p></div>
                <button type="button" class="btn btn-outline-secondary rounded-circle p-0 flex-none wish" style="width:44px" aria-pressed="false" aria-label="Save Herbalism Cleanser to wishlist"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><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 21.2l7.8-7.7 1-1.1a5.5 5.5 0 0 0 0-7.8z"/></svg></button>
              </div>
              <div class="d-flex align-items-center gap-2 mb-4 small"><span class="text-warning d-inline-flex" role="img" aria-label="4.5 out of 5 stars"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><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" fill="currentColor"><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" fill="currentColor"><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" fill="currentColor"><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" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"><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="wdw-muted">1,590 reviews</span></div>
              <div class="wdw-eyebrow mb-2">Size</div>
              <div class="d-flex gap-2 mb-4"><input type="radio" class="btn-check" name="s1" id="s1-0" data-price="12.95" autocomplete="off" checked>
<label class="size-opt" for="s1-0"><span class="fw-bold">1.5 oz</span><span class="small">$12.95</span></label>
<input type="radio" class="btn-check" name="s1" id="s1-1" data-price="21.95" autocomplete="off">
<label class="size-opt" for="s1-1"><span class="fw-bold">4.4 oz</span><span class="small">$21.95</span></label>
</div>
              <div class="mt-auto d-flex flex-wrap align-items-center justify-content-between gap-3">
                <div><div class="small wdw-muted">Total</div><div class="fs-3 fw-bold text-body-emphasis">$<span class="js-price">12.95</span></div></div>
                <button type="button" class="btn btn-primary rounded-pill px-4 add-cart">Add to cart</button>
              </div>
            </div>
          </div>
        </div>
        <div class="carousel-item">
          <div class="row g-0 align-items-stretch">
            <div class="col-md-5"><img class="pdp-img" src="https://images.unsplash.com/photo-1620916566398-39f1143ab7be?auto=format&fit=crop&w=800&q=80" alt="Silk Body Lotion tube on a neutral background" loading="lazy"></div>
            <div class="col-md-7 p-4 p-lg-5 d-flex flex-column">
              <nav aria-label="breadcrumb"><ol class="breadcrumb small mb-3"><li class="breadcrumb-item"><a href="#">Home</a></li><li class="breadcrumb-item"><a href="#">Skincare</a></li><li class="breadcrumb-item active" aria-current="page">Moisturisers</li></ol></nav>
              <div class="d-flex justify-content-between align-items-start gap-3">
                <div><h2 class="wdw-heading h2 mb-1">Silk Body Lotion</h2><p class="wdw-muted mb-2">Fragrance-free emulsion for dry, sensitive skin</p></div>
                <button type="button" class="btn btn-outline-secondary rounded-circle p-0 flex-none wish" style="width:44px" aria-pressed="false" aria-label="Save Silk Body Lotion to wishlist"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><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 21.2l7.8-7.7 1-1.1a5.5 5.5 0 0 0 0-7.8z"/></svg></button>
              </div>
              <div class="d-flex align-items-center gap-2 mb-4 small"><span class="text-warning d-inline-flex" role="img" aria-label="4.5 out of 5 stars"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><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" fill="currentColor"><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" fill="currentColor"><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" fill="currentColor"><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" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"><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="wdw-muted">842 reviews</span></div>
              <div class="wdw-eyebrow mb-2">Size</div>
              <div class="d-flex gap-2 mb-4"><input type="radio" class="btn-check" name="s2" id="s2-0" data-price="18.50" autocomplete="off" checked>
<label class="size-opt" for="s2-0"><span class="fw-bold">6 oz</span><span class="small">$18.50</span></label>
<input type="radio" class="btn-check" name="s2" id="s2-1" data-price="31.00" autocomplete="off">
<label class="size-opt" for="s2-1"><span class="fw-bold">13 oz</span><span class="small">$31.00</span></label>
</div>
              <div class="mt-auto d-flex flex-wrap align-items-center justify-content-between gap-3">
                <div><div class="small wdw-muted">Total</div><div class="fs-3 fw-bold text-body-emphasis">$<span class="js-price">18.50</span></div></div>
                <button type="button" class="btn btn-primary rounded-pill px-4 add-cart">Add to cart</button>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="pdp-controls d-flex align-items-center gap-2">
        <button class="btn btn-light rounded-circle p-0 shadow-sm" style="width:44px" type="button" data-bs-target="#pdpCarousel" data-bs-slide="prev" aria-label="Previous product"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"/></svg></button>
        <span class="small fw-semibold text-body-secondary px-2" id="pdpCount" aria-live="polite">1 / 2</span>
        <button class="btn btn-light rounded-circle p-0 shadow-sm" style="width:44px" type="button" data-bs-target="#pdpCarousel" data-bs-slide="next" aria-label="Next product"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 6 6 6-6 6"/></svg></button>
      </div>
    </div>
  </div>
</section>

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