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.
<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>
/* Web Designer Wall library style — shared base for every Bootstrap 5 snippet.
Indigo accent, Plus Jakarta Sans, soft cards, pill buttons. Works in light and dark. */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");
:root,
[data-bs-theme="light"] {
--wdw-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--bs-body-font-family: var(--wdw-font);
--bs-primary: #4f46e5;
--bs-primary-rgb: 79, 70, 229;
--bs-primary-text-emphasis: #3730a3;
--bs-primary-bg-subtle: #eef2ff;
--bs-primary-border-subtle: #c7d2fe;
--bs-link-color: #4f46e5;
--bs-link-color-rgb: 79, 70, 229;
--bs-link-hover-color: #4338ca;
--bs-link-hover-color-rgb: 67, 56, 202;
--bs-focus-ring-color: rgba(79, 70, 229, 0.25);
--bs-border-radius: 0.75rem;
--bs-border-radius-lg: 1rem;
--bs-border-radius-xl: 1.25rem;
--wdw-radius-card: 1.25rem;
--wdw-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 16px 40px -16px rgba(16, 24, 40, 0.22);
--wdw-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px -4px rgba(16, 24, 40, 0.12);
--wdw-stage: #f5f6fb;
}
[data-bs-theme="dark"] {
--bs-primary: #818cf8;
--bs-primary-rgb: 129, 140, 248;
--bs-primary-text-emphasis: #c7d2fe;
--bs-primary-bg-subtle: rgba(129, 140, 248, 0.14);
--bs-primary-border-subtle: rgba(129, 140, 248, 0.35);
--bs-link-color: #a5b4fc;
--bs-link-color-rgb: 165, 180, 252;
--bs-link-hover-color: #c7d2fe;
--bs-link-hover-color-rgb: 199, 210, 254;
--bs-focus-ring-color: rgba(129, 140, 248, 0.35);
--wdw-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
--wdw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
--wdw-stage: #0f1117;
}
body { font-family: var(--wdw-font); -webkit-font-smoothing: antialiased; }
/* Bootstrap compiles its blue into these components; point them at the accent. */
.btn-primary {
--bs-btn-bg: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
--bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
--bs-btn-disabled-bg: var(--bs-primary); --bs-btn-disabled-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0f1117; --bs-btn-hover-bg: #a5b4fc; --bs-btn-hover-border-color: #a5b4fc; --bs-btn-hover-color: #0f1117; --bs-btn-active-color: #0f1117; }
.btn-outline-primary {
--bs-btn-color: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: var(--bs-primary); --bs-btn-hover-border-color: var(--bs-primary);
--bs-btn-active-bg: var(--bs-primary); --bs-btn-active-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
.btn { --bs-btn-font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn-sm { min-height: 36px; }
.form-control, .form-select { min-height: 44px; border-radius: .75rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: rgba(var(--bs-primary-rgb), .6); box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--bs-primary); }
.nav { --bs-nav-link-color: var(--bs-secondary-color); --bs-nav-link-hover-color: var(--bs-emphasis-color); }
.pagination { --bs-pagination-active-bg: var(--bs-primary); --bs-pagination-active-border-color: var(--bs-primary); --bs-pagination-color: var(--bs-body-color); --bs-pagination-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.progress, .progress-stacked { --bs-progress-bar-bg: var(--bs-primary); }
.list-group { --bs-list-group-active-bg: var(--bs-primary); --bs-list-group-active-border-color: var(--bs-primary); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--bs-primary); border-radius: .875rem; box-shadow: var(--wdw-shadow-sm); }
.accordion { --bs-accordion-active-bg: var(--bs-primary-bg-subtle); --bs-accordion-active-color: var(--bs-primary-text-emphasis); --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.badge { font-weight: 600; }
/* Library building blocks — use these instead of re-inventing them per snippet. */
.wdw-stage { min-height: 100vh; display: flex; align-items: center; background: var(--wdw-stage); padding-block: 3rem; }
.wdw-card { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: var(--wdw-radius-card); box-shadow: var(--wdw-shadow); }
.wdw-card-sm { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: 1rem; box-shadow: var(--wdw-shadow-sm); }
.wdw-aurora { position: relative; color: #fff; background: radial-gradient(60% 55% at 100% 0, #818cf8 0, transparent 70%), radial-gradient(65% 60% at 0 100%, #ec4899 0, transparent 65%), #1e1b4b; }
.wdw-eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bs-primary); }
.wdw-heading { font-weight: 800; letter-spacing: -.02em; color: var(--bs-emphasis-color); }
.wdw-muted { color: var(--bs-secondary-color); }
.wdw-icon { width: 2.75rem; height: 2.75rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: .875rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
/* Component */
.topics-head { display: flex; align-items: center; gap: .75rem; padding: .875rem 1.5rem; border-bottom: 1px solid var(--bs-border-color-translucent); }
.topics-head .wdw-icon { width: 36px; height: 36px; }
.gallery-img { width: 100%; height: 100%; min-height: 150px; object-fit: cover; display: block; }
.chip-pick { display: inline-flex; align-items: center; gap: .4rem; min-height: 48px; padding: 0 1.25rem; border-radius: 999px; font-size: 1rem; font-weight: 600; cursor: pointer; border: 1px solid var(--bs-border-color); color: var(--bs-body-color); background: var(--bs-body-bg); transition: background .15s, color .15s, border-color .15s; }
.chip-pick::before { content: ""; width: 0; height: 1em; background: currentColor; transition: width .15s; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat; }
.chip-pick:hover { border-color: var(--bs-primary); }
.btn-check:checked + .chip-pick { background: var(--bs-primary-bg-subtle); border-color: var(--bs-primary); color: var(--bs-primary-text-emphasis); }
.btn-check:checked + .chip-pick::before { width: 1em; }
.btn-check:focus-visible + .chip-pick { outline: 3px solid var(--bs-focus-ring-color); outline-offset: 2px; }
function initTopicChips() {
const box = document.getElementById('topicChips');
const out = document.getElementById('topicCount');
const bar = document.getElementById('topicBar');
const fill = document.getElementById('topicFill');
const go = document.getElementById('topicGo');
if (!box || !out) return;
const update = () => {
const n = box.querySelectorAll('input:checked').length;
out.textContent = n >= 3 ? n + ' selected' : n + ' selected, pick ' + (3 - n) + ' more';
if (bar) bar.setAttribute('aria-valuenow', Math.min(n, 3));
if (fill) fill.style.width = Math.min(n, 3) / 3 * 100 + '%';
if (go) go.disabled = n < 3;
};
box.addEventListener('change', update);
update();
}
initTopicChips();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.