Snippets Carousel

Bootstrap 5 Multiple Item Product Carousel

A multi-item product carousel built on scroll-snap, showing four cards per view on desktop and fewer on small screens. Arrow buttons, keyboard arrows, swipe and position dots all work.

Bootstrap 5 No jQuery Sep 2020 2.5K views

<section class="wdw-stage">
  <div class="container" style="max-width:1120px">
    <div class="d-flex flex-wrap align-items-end justify-content-between gap-3 mb-4">
      <div><span class="wdw-eyebrow">Shop</span><h1 class="wdw-heading h2 mt-1 mb-0">Trending products</h1></div>
      <div class="d-flex gap-2">
        <button type="button" class="btn btn-outline-secondary rounded-circle p-0 pc-nav" id="pcPrev" aria-label="Previous products"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 6l-6 6 6 6"/></svg></button>
        <button type="button" class="btn btn-outline-secondary rounded-circle p-0 pc-nav" id="pcNext" aria-label="Next products"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg></button>
      </div>
    </div>
    <div role="region" aria-roledescription="carousel" aria-label="Trending products">
      <ul class="pc-track list-unstyled m-0" id="pcTrack" tabindex="0">
        <li class="pc-slide"><article class="card border-0 wdw-card-sm h-100 overflow-hidden">
          <div class="pc-img"><img src="https://images.unsplash.com/photo-1542291026-7eec264c27ff?auto=format&fit=crop&w=600&h=480&q=80" alt="Red running sneaker on a pale background" loading="lazy"></div>
          <div class="card-body p-3 d-flex flex-column">
            <span class="wdw-eyebrow">Footwear</span>
            <h3 class="h6 fw-bold mt-1 mb-2">Court Classic Sneaker</h3>
            <div class="d-flex align-items-center justify-content-between mt-auto"><span class="fs-5 fw-bold text-body-emphasis">$89</span><button type="button" class="btn btn-primary btn-sm rounded-pill px-3">Add to cart</button></div>
          </div></article></li>
        <li class="pc-slide"><article class="card border-0 wdw-card-sm h-100 overflow-hidden">
          <div class="pc-img"><img src="https://images.unsplash.com/photo-1505740420928-5e560c06d30e?auto=format&fit=crop&w=600&h=480&q=80" alt="Over-ear headphones in white" loading="lazy"></div>
          <div class="card-body p-3 d-flex flex-column">
            <span class="wdw-eyebrow">Audio</span>
            <h3 class="h6 fw-bold mt-1 mb-2">Studio Headphones</h3>
            <div class="d-flex align-items-center justify-content-between mt-auto"><span class="fs-5 fw-bold text-body-emphasis">$149</span><button type="button" class="btn btn-primary btn-sm rounded-pill px-3">Add to cart</button></div>
          </div></article></li>
        <li class="pc-slide"><article class="card border-0 wdw-card-sm h-100 overflow-hidden">
          <div class="pc-img"><img src="https://images.unsplash.com/photo-1523275335684-37898b6baf30?auto=format&fit=crop&w=600&h=480&q=80" alt="Minimal analogue wristwatch" loading="lazy"></div>
          <div class="card-body p-3 d-flex flex-column">
            <span class="wdw-eyebrow">Watches</span>
            <h3 class="h6 fw-bold mt-1 mb-2">Field Chronograph</h3>
            <div class="d-flex align-items-center justify-content-between mt-auto"><span class="fs-5 fw-bold text-body-emphasis">$219</span><button type="button" class="btn btn-primary btn-sm rounded-pill px-3">Add to cart</button></div>
          </div></article></li>
        <li class="pc-slide"><article class="card border-0 wdw-card-sm h-100 overflow-hidden">
          <div class="pc-img"><img src="https://images.unsplash.com/photo-1491553895911-0055eca6402d?auto=format&fit=crop&w=600&h=480&q=80" alt="Pair of sneakers on a coloured backdrop" loading="lazy"></div>
          <div class="card-body p-3 d-flex flex-column">
            <span class="wdw-eyebrow">Footwear</span>
            <h3 class="h6 fw-bold mt-1 mb-2">Everyday Runner</h3>
            <div class="d-flex align-items-center justify-content-between mt-auto"><span class="fs-5 fw-bold text-body-emphasis">$109</span><button type="button" class="btn btn-primary btn-sm rounded-pill px-3">Add to cart</button></div>
          </div></article></li>
        <li class="pc-slide"><article class="card border-0 wdw-card-sm h-100 overflow-hidden">
          <div class="pc-img"><img src="https://images.unsplash.com/photo-1572635196237-14b3f281503f?auto=format&fit=crop&w=600&h=480&q=80" alt="Sunglasses on a yellow surface" loading="lazy"></div>
          <div class="card-body p-3 d-flex flex-column">
            <span class="wdw-eyebrow">Eyewear</span>
            <h3 class="h6 fw-bold mt-1 mb-2">Classic Shades</h3>
            <div class="d-flex align-items-center justify-content-between mt-auto"><span class="fs-5 fw-bold text-body-emphasis">$79</span><button type="button" class="btn btn-primary btn-sm rounded-pill px-3">Add to cart</button></div>
          </div></article></li>
        <li class="pc-slide"><article class="card border-0 wdw-card-sm h-100 overflow-hidden">
          <div class="pc-img"><img src="https://images.unsplash.com/photo-1526170375885-4d8ecf77b99f?auto=format&fit=crop&w=600&h=480&q=80" alt="Vintage film camera" loading="lazy"></div>
          <div class="card-body p-3 d-flex flex-column">
            <span class="wdw-eyebrow">Photo</span>
            <h3 class="h6 fw-bold mt-1 mb-2">Film Camera</h3>
            <div class="d-flex align-items-center justify-content-between mt-auto"><span class="fs-5 fw-bold text-body-emphasis">$329</span><button type="button" class="btn btn-primary btn-sm rounded-pill px-3">Add to cart</button></div>
          </div></article></li>
      </ul>
    </div>
    <div class="d-flex justify-content-center gap-2 mt-4" id="pcDots" aria-hidden="true"></div>
  </div>
</section>

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

Free to use in personal and commercial projects under the MIT license.