Snippets Card

Bootstrap 5 Product Card Grid for Ecommerce

A responsive product grid of ecommerce cards with photos, sale badges, ratings, prices, a wishlist heart and an add-to-cart button that updates a cart counter.

Bootstrap 5 No jQuery May 2020 3.6K views

<section class="wdw-stage">
  <div class="container" style="max-width: 1140px">
    <div class="d-flex flex-wrap justify-content-between align-items-end gap-3 mb-4">
      <div>
        <span class="wdw-eyebrow">Best sellers</span>
        <h1 class="wdw-heading h2 mt-1 mb-0">Shop top picks</h1>
      </div>
      <button type="button" class="btn btn-outline-primary rounded-pill position-relative" id="cartBtn" aria-live="polite">
        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="9" cy="20" r="1.500"/><circle cx="18" cy="20" r="1.500"/><path d="M2 3h3l2.500 12h11l2-8H6"/></svg>
        Cart <span class="badge rounded-pill text-bg-primary" id="cartCount">0</span>
      </button>
    </div>
    <div class="row g-4 row-cols-1 row-cols-sm-2 row-cols-lg-4">
      <div class="col">
        <article class="pcard wdw-card h-100 d-flex flex-column overflow-hidden">
          <div class="pcard-media position-relative">
            <img src="https://images.unsplash.com/photo-1496181133206-80ce9b88a853?auto=format&fit=crop&w=600&q=70" alt="Toshiba Notebook, 500GB HDD and 8GB RAM" width="600" height="450" loading="lazy">
            <span class="badge rounded-pill text-bg-danger pcard-tag">Save 24%</span>
            <button type="button" class="pcard-wish" aria-pressed="false" aria-label="Add Toshiba Notebook, 500GB HDD and 8GB RAM to wishlist"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20.8 4.600a5.500 5.500 0 0 0-7.800 0L12 5.700l-1-1.100a5.500 5.500 0 0 0-7.800 7.800l1 1.100L12 21.300l7.800-7.800 1-1.100a5.500 5.500 0 0 0 0-7.800Z"/></svg></button>
          </div>
          <div class="p-3 p-lg-4 d-flex flex-column flex-grow-1">
            <a href="#" class="small text-primary fw-semibold text-decoration-none">Laptops & Notebooks</a>
            <h2 class="h6 fw-bold mt-1 mb-2"><a href="#" class="link-body-emphasis text-decoration-none">Toshiba Notebook, 500GB HDD and 8GB RAM</a></h2>
            <div class="d-flex align-items-center gap-2 small mb-3"><span class="text-warning d-inline-flex" role="img" aria-label="Rated 4 out of 5"><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg></span><span class="wdw-muted">(34)</span></div>
            <div class="mt-auto">
              <div class="d-flex align-items-baseline gap-2 mb-3"><span class="h4 fw-bold mb-0">$250.99</span><s class="small wdw-muted">$329.00</s></div>
              <button type="button" class="btn btn-primary rounded-pill w-100 add-cart">Add to cart</button>
            </div>
          </div>
        </article>
      </div>
      <div class="col">
        <article class="pcard wdw-card h-100 d-flex flex-column overflow-hidden">
          <div class="pcard-media position-relative">
            <img src="https://images.unsplash.com/photo-1505740420928-5e560c06d30e?auto=format&fit=crop&w=600&q=70" alt="Wireless Over-Ear Headphones" width="600" height="450" loading="lazy">
            <span class="badge rounded-pill text-bg-dark pcard-tag">New</span>
            <button type="button" class="pcard-wish" aria-pressed="false" aria-label="Add Wireless Over-Ear Headphones to wishlist"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20.8 4.600a5.500 5.500 0 0 0-7.800 0L12 5.700l-1-1.100a5.500 5.500 0 0 0-7.800 7.800l1 1.100L12 21.300l7.800-7.800 1-1.100a5.500 5.500 0 0 0 0-7.800Z"/></svg></button>
          </div>
          <div class="p-3 p-lg-4 d-flex flex-column flex-grow-1">
            <a href="#" class="small text-primary fw-semibold text-decoration-none">Audio</a>
            <h2 class="h6 fw-bold mt-1 mb-2"><a href="#" class="link-body-emphasis text-decoration-none">Wireless Over-Ear Headphones</a></h2>
            <div class="d-flex align-items-center gap-2 small mb-3"><span class="text-warning d-inline-flex" role="img" aria-label="Rated 5 out of 5"><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg></span><span class="wdw-muted">(128)</span></div>
            <div class="mt-auto">
              <div class="d-flex align-items-baseline gap-2 mb-3"><span class="h4 fw-bold mb-0">$129.00</span></div>
              <button type="button" class="btn btn-primary rounded-pill w-100 add-cart">Add to cart</button>
            </div>
          </div>
        </article>
      </div>
      <div class="col">
        <article class="pcard wdw-card h-100 d-flex flex-column overflow-hidden">
          <div class="pcard-media position-relative">
            <img src="https://images.unsplash.com/photo-1523275335684-37898b6baf30?auto=format&fit=crop&w=600&q=70" alt="Minimal Analog Watch, Steel" width="600" height="450" loading="lazy">
            <span class="badge rounded-pill text-bg-danger pcard-tag">Save 19%</span>
            <button type="button" class="pcard-wish" aria-pressed="false" aria-label="Add Minimal Analog Watch, Steel to wishlist"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20.8 4.600a5.500 5.500 0 0 0-7.800 0L12 5.700l-1-1.100a5.500 5.500 0 0 0-7.800 7.800l1 1.100L12 21.300l7.800-7.800 1-1.100a5.500 5.500 0 0 0 0-7.800Z"/></svg></button>
          </div>
          <div class="p-3 p-lg-4 d-flex flex-column flex-grow-1">
            <a href="#" class="small text-primary fw-semibold text-decoration-none">Accessories</a>
            <h2 class="h6 fw-bold mt-1 mb-2"><a href="#" class="link-body-emphasis text-decoration-none">Minimal Analog Watch, Steel</a></h2>
            <div class="d-flex align-items-center gap-2 small mb-3"><span class="text-warning d-inline-flex" role="img" aria-label="Rated 4 out of 5"><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg></span><span class="wdw-muted">(57)</span></div>
            <div class="mt-auto">
              <div class="d-flex align-items-baseline gap-2 mb-3"><span class="h4 fw-bold mb-0">$89.50</span><s class="small wdw-muted">$110.00</s></div>
              <button type="button" class="btn btn-primary rounded-pill w-100 add-cart">Add to cart</button>
            </div>
          </div>
        </article>
      </div>
      <div class="col">
        <article class="pcard wdw-card h-100 d-flex flex-column overflow-hidden">
          <div class="pcard-media position-relative">
            <img src="https://images.unsplash.com/photo-1542291026-7eec264c27ff?auto=format&fit=crop&w=600&q=70" alt="Everyday Running Sneakers" width="600" height="450" loading="lazy">
            
            <button type="button" class="pcard-wish" aria-pressed="false" aria-label="Add Everyday Running Sneakers to wishlist"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20.8 4.600a5.500 5.500 0 0 0-7.800 0L12 5.700l-1-1.100a5.500 5.500 0 0 0-7.800 7.800l1 1.100L12 21.300l7.800-7.800 1-1.100a5.500 5.500 0 0 0 0-7.800Z"/></svg></button>
          </div>
          <div class="p-3 p-lg-4 d-flex flex-column flex-grow-1">
            <a href="#" class="small text-primary fw-semibold text-decoration-none">Footwear</a>
            <h2 class="h6 fw-bold mt-1 mb-2"><a href="#" class="link-body-emphasis text-decoration-none">Everyday Running Sneakers</a></h2>
            <div class="d-flex align-items-center gap-2 small mb-3"><span class="text-warning d-inline-flex" role="img" aria-label="Rated 5 out of 5"><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.500l6.100-.9L12 3Z"/></svg></span><span class="wdw-muted">(212)</span></div>
            <div class="mt-auto">
              <div class="d-flex align-items-baseline gap-2 mb-3"><span class="h4 fw-bold mb-0">$74.00</span></div>
              <button type="button" class="btn btn-primary rounded-pill w-100 add-cart">Add to cart</button>
            </div>
          </div>
        </article>
      </div>
    </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.