Snippets Card

Bootstrap 5 Cards with Chips and Tags

A set of three modern cards built around chips: opening-hour pills, selectable topic chips with a live counter, and a notification card with tags.

Bootstrap 5 No jQuery Oct 2019 2.5K views

<section class="wdw-stage">
  <div class="container" style="max-width:1100px">
    <div class="row g-4 align-items-stretch">
      <div class="col-lg-7">
        <article class="card h-100 border-0 wdw-card">
          <header class="topics-head"><span class="wdw-icon" aria-hidden="true"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round"><path d="M20.6 13.4 13.4 20.6a2 2 0 0 1-2.8 0L3 13V3h10l7.6 7.6a2 2 0 0 1 0 2.8z"/><circle cx="7.5" cy="7.5" r="1"/></svg></span><span class="wdw-eyebrow">Personalise</span></header>
          <div class="card-body p-4 p-lg-5 d-flex flex-column">
            <h2 class="h2 wdw-heading">Choose topics that interest you</h2>
            <p class="wdw-muted">Pick at least three to tailor your feed.</p>
            <div class="d-flex flex-wrap gap-2 gap-lg-3 my-4" id="topicChips" role="group" aria-label="Topics">
              <input type="checkbox" class="btn-check" id="t1" autocomplete="off" checked><label class="chip-pick" for="t1">Design</label>
              <input type="checkbox" class="btn-check" id="t2" autocomplete="off"><label class="chip-pick" for="t2">Photography</label>
              <input type="checkbox" class="btn-check" id="t3" autocomplete="off" checked><label class="chip-pick" for="t3">Frontend</label>
              <input type="checkbox" class="btn-check" id="t4" autocomplete="off"><label class="chip-pick" for="t4">Typography</label>
              <input type="checkbox" class="btn-check" id="t5" autocomplete="off"><label class="chip-pick" for="t5">Illustration</label>
              <input type="checkbox" class="btn-check" id="t6" autocomplete="off" checked><label class="chip-pick" for="t6">Accessibility</label>
              <input type="checkbox" class="btn-check" id="t7" autocomplete="off"><label class="chip-pick" for="t7">Motion</label>
              <input type="checkbox" class="btn-check" id="t8" autocomplete="off"><label class="chip-pick" for="t8">Branding</label>
            </div>
            <div class="mt-auto">
              <div class="progress mb-2" style="height:8px" role="progressbar" aria-label="Topics selected" aria-valuemin="0" aria-valuemax="3" aria-valuenow="3" id="topicBar"><div class="progress-bar" id="topicFill" style="width:100%"></div></div>
              <div class="d-flex align-items-center justify-content-between gap-3">
                <span class="small wdw-muted" id="topicCount" aria-live="polite">3 selected</span>
                <button type="button" class="btn btn-primary rounded-pill px-4" id="topicGo">Continue</button>
              </div>
            </div>
          </div>
        </article>
      </div>
      <div class="col-lg-5 d-grid gap-4">
        <article class="card border-0 wdw-card overflow-hidden">
          <header class="topics-head"><span class="wdw-icon" aria-hidden="true"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="3"/><circle cx="9" cy="9" r="1.5"/><path d="m21 15-5-5L5 21"/></svg></span><span class="wdw-eyebrow">Gallery</span></header>
          <div class="row g-0 align-items-stretch">
            <div class="col-5"><img src="https://images.unsplash.com/photo-1490750967868-88aa4486c946?auto=format&fit=crop&w=420&h=420&q=80" class="gallery-img" alt="Orange poppies in a sunlit field" width="210" height="210"></div>
            <div class="col-7"><div class="p-3 p-lg-4">
              <h3 class="h6 wdw-heading mb-1">Fine Art Pictures Gallery</h3>
              <ul class="list-unstyled small mb-0 mt-3 d-grid gap-2">
                <li class="d-flex justify-content-between align-items-center gap-2"><span>Tue – Fri</span><span class="badge rounded-pill bg-primary-subtle text-primary-emphasis">10 – 18</span></li>
                <li class="d-flex justify-content-between align-items-center gap-2"><span>Sat – Sun</span><span class="badge rounded-pill bg-primary-subtle text-primary-emphasis">9 – 19</span></li>
                <li class="d-flex justify-content-between align-items-center gap-2"><span>Monday</span><span class="badge rounded-pill bg-danger-subtle text-danger-emphasis">Closed</span></li>
              </ul>
            </div></div>
          </div>
        </article>
        <article class="card border-0 wdw-card">
          <header class="topics-head"><span class="wdw-icon" aria-hidden="true"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/></svg></span><span class="wdw-eyebrow">Notification</span><span class="badge rounded-pill bg-primary-subtle text-primary-emphasis ms-auto">New</span></header>
          <div class="card-body p-4">
            <div class="d-flex align-items-center gap-3">
              <img src="https://i.pravatar.cc/96?img=12" width="40" height="40" class="rounded-circle" alt="Tony">
              <div class="lh-sm"><div class="fw-bold">Tony</div><small class="wdw-muted">2 h ago</small></div>
            </div>
            <h3 class="h6 wdw-heading mt-3">Video player setup error 153</h3>
            <p class="wdw-muted small mb-2">Tony posted a fix for embedded players that refuse to load.</p>
            <div class="d-flex flex-wrap gap-2 mb-3">
              <span class="badge rounded-pill bg-primary-subtle text-primary-emphasis">#video</span><span class="badge rounded-pill bg-primary-subtle text-primary-emphasis">#embed</span><span class="badge rounded-pill bg-primary-subtle text-primary-emphasis">Error 153</span>
            </div>
            <div class="d-flex flex-wrap gap-2">
              <a href="#" class="btn btn-primary rounded-pill flex-fill">Watch the fix</a>
              <button type="button" class="btn btn-outline-primary rounded-pill flex-fill">Remind me later</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.