Bootstrap 5 Scrolling Card Carousel
A swipeable card carousel showing three cards at a time on desktop with aurora headers, arrow buttons and a progress bar.
<section class="wdw-stage">
<div class="container" style="max-width: 1080px">
<div class="d-flex flex-wrap align-items-end justify-content-between gap-3 mb-4">
<div>
<span class="wdw-eyebrow">Play together</span>
<h2 class="wdw-heading display-6 mb-1">Games for the whole family</h2>
<p class="wdw-muted fs-5 mb-0">Six ways to turn a free evening into a shared one.</p>
</div>
<div class="d-flex gap-2" role="group" aria-label="Carousel controls">
<button type="button" class="btn btn-outline-secondary rounded-circle p-0 cc-prev" style="width:44px" aria-label="Previous games">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.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-primary rounded-circle p-0 cc-next" style="width:44px" aria-label="Next games">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg></button>
</div>
</div>
<div class="cc-carousel" role="region" aria-roledescription="carousel" aria-label="Family games">
<ul class="cc-track list-unstyled mb-0">
<li class="cc-slide" role="group" aria-roledescription="slide" aria-label="1 of 6">
<article class="wdw-card-sm h-100 overflow-hidden d-flex flex-column">
<div class="cc-head wdw-aurora cc-tone-0 d-flex align-items-start justify-content-between p-4">
<span class="cc-glyph" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M9 12l2 2 4-4M12 3l2.5 2.2 3.3-.3.8 3.2 2.9 1.7-1.3 3 1.3 3-2.9 1.7-.8 3.2-3.3-.3L12 21l-2.5-2.2-3.3.3-.8-3.2L2.5 14l1.3-3-1.3-3 2.9-1.7.8-3.2 3.3.3z"/></svg></span>
<span class="badge rounded-pill cc-badge">01 / 06</span>
</div>
<div class="p-4 d-flex flex-column flex-grow-1">
<h3 class="h4 wdw-heading mb-2">Who's the best?</h3>
<p class="wdw-muted mb-4">1500 questions and answers for family or friends. Five categories, from history and geography to general culture.</p>
<a href="#" class="btn btn-outline-primary rounded-pill mt-auto align-self-start px-4" aria-label="Learn more about Who's the best?">Learn more</a>
</div>
</article>
</li>
<li class="cc-slide" role="group" aria-roledescription="slide" aria-label="2 of 6">
<article class="wdw-card-sm h-100 overflow-hidden d-flex flex-column">
<div class="cc-head wdw-aurora cc-tone-1 d-flex align-items-start justify-content-between p-4">
<span class="cc-glyph" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2l9 5v10l-9 5-9-5V7zM12 12l9-5M12 12v10M12 12L3 7"/></svg></span>
<span class="badge rounded-pill cc-badge">02 / 06</span>
</div>
<div class="p-4 d-flex flex-column flex-grow-1">
<h3 class="h4 wdw-heading mb-2">Story Cubes</h3>
<p class="wdw-muted mb-4">Roll nine dice and invent a tale together. Ideal for evenings with children and grandparents alike.</p>
<a href="#" class="btn btn-outline-primary rounded-pill mt-auto align-self-start px-4" aria-label="Learn more about Story Cubes">Learn more</a>
</div>
</article>
</li>
<li class="cc-slide" role="group" aria-roledescription="slide" aria-label="3 of 6">
<article class="wdw-card-sm h-100 overflow-hidden d-flex flex-column">
<div class="cc-head wdw-aurora cc-tone-2 d-flex align-items-start justify-content-between p-4">
<span class="cc-glyph" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4 5h16v11H9l-5 4zM8 9h8M8 12h5"/></svg></span>
<span class="badge rounded-pill cc-badge">03 / 06</span>
</div>
<div class="p-4 d-flex flex-column flex-grow-1">
<h3 class="h4 wdw-heading mb-2">Table Talk</h3>
<p class="wdw-muted mb-4">Conversation cards that spark real discussion around the Shabbat table, from light to deep.</p>
<a href="#" class="btn btn-outline-primary rounded-pill mt-auto align-self-start px-4" aria-label="Learn more about Table Talk">Learn more</a>
</div>
</article>
</li>
<li class="cc-slide" role="group" aria-roledescription="slide" aria-label="4 of 6">
<article class="wdw-card-sm h-100 overflow-hidden d-flex flex-column">
<div class="cc-head wdw-aurora cc-tone-0 d-flex align-items-start justify-content-between p-4">
<span class="cc-glyph" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M8 21h8M12 17v4M7 4h10v5a5 5 0 0 1-10 0zM17 5h3v2a3 3 0 0 1-3 3M7 5H4v2a3 3 0 0 0 3 3"/></svg></span>
<span class="badge rounded-pill cc-badge">04 / 06</span>
</div>
<div class="p-4 d-flex flex-column flex-grow-1">
<h3 class="h4 wdw-heading mb-2">Trivia Duel</h3>
<p class="wdw-muted mb-4">Fast head-to-head rounds for two players. Answer first, climb the ladder, claim the crown.</p>
<a href="#" class="btn btn-outline-primary rounded-pill mt-auto align-self-start px-4" aria-label="Learn more about Trivia Duel">Learn more</a>
</div>
</article>
</li>
<li class="cc-slide" role="group" aria-roledescription="slide" aria-label="5 of 6">
<article class="wdw-card-sm h-100 overflow-hidden d-flex flex-column">
<div class="cc-head wdw-aurora cc-tone-1 d-flex align-items-start justify-content-between p-4">
<span class="cc-glyph" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"/></svg></span>
<span class="badge rounded-pill cc-badge">05 / 06</span>
</div>
<div class="p-4 d-flex flex-column flex-grow-1">
<h3 class="h4 wdw-heading mb-2">Word Chain</h3>
<p class="wdw-muted mb-4">Build chains of words under a ticking clock. Simple rules, endless rounds, all ages.</p>
<a href="#" class="btn btn-outline-primary rounded-pill mt-auto align-self-start px-4" aria-label="Learn more about Word Chain">Learn more</a>
</div>
</article>
</li>
<li class="cc-slide" role="group" aria-roledescription="slide" aria-label="6 of 6">
<article class="wdw-card-sm h-100 overflow-hidden d-flex flex-column">
<div class="cc-head wdw-aurora cc-tone-2 d-flex align-items-start justify-content-between p-4">
<span class="cc-glyph" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 8v4l3 2M21 12a9 9 0 1 1-3-6.7M21 4v5h-5"/></svg></span>
<span class="badge rounded-pill cc-badge">06 / 06</span>
</div>
<div class="p-4 d-flex flex-column flex-grow-1">
<h3 class="h4 wdw-heading mb-2">Memory Lane</h3>
<p class="wdw-muted mb-4">Match pairs from family history and tradition. A gentle game that trains recall for everyone.</p>
<a href="#" class="btn btn-outline-primary rounded-pill mt-auto align-self-start px-4" aria-label="Learn more about Memory Lane">Learn more</a>
</div>
</article>
</li>
</ul>
</div>
<div class="cc-progress progress mt-4" role="progressbar" aria-label="Carousel position" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" style="height:4px"><div class="progress-bar" style="width:0"></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 */
.cc-carousel { overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: .5rem; scrollbar-width: none; margin-inline: -.5rem; padding: .5rem .5rem 1.5rem; border-radius: 1rem; }
.cc-carousel::-webkit-scrollbar { display: none; }
.cc-track { display: flex; gap: 1.25rem; }
.cc-slide { flex: 0 0 calc((100% - 2.5rem) / 3); scroll-snap-align: start; }
.cc-slide article { transition: transform .25s ease, box-shadow .25s ease; }
.cc-slide article:hover { transform: translateY(-4px); box-shadow: var(--wdw-shadow); }
.cc-head { min-height: 8.5rem; }
.cc-tone-1 { background-position: 40% 0, 100% 100%, 0 0; }
.cc-tone-2 { background-position: 0 100%, 60% 0, 0 0; }
.cc-glyph { width: 3rem; height: 3rem; display: inline-flex; align-items: center; justify-content: center; border-radius: .875rem; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: #fff; }
.cc-badge { background: rgba(255,255,255,.16); color: #fff; letter-spacing: .04em; border: 1px solid rgba(255,255,255,.28); }
@media (max-width: 991.98px) { .cc-slide { flex-basis: calc((100% - 1.25rem) / 2); } }
@media (max-width: 575.98px) { .cc-slide { flex-basis: 86%; } }
@media (prefers-reduced-motion: reduce) { .cc-slide article { transition: none; } }
.cc-prev:disabled, .cc-next:disabled { opacity: .4; }
function initCardCarousel() {
var view = document.querySelector('.cc-carousel');
var prev = document.querySelector('.cc-prev');
var next = document.querySelector('.cc-next');
var bar = document.querySelector('.cc-progress');
if (!view || !prev || !next) return;
function step() {
var slide = view.querySelector('.cc-slide');
return slide ? slide.getBoundingClientRect().width + 20 : 300;
}
function update() {
var max = view.scrollWidth - view.clientWidth;
var pct = max > 0 ? view.scrollLeft / max * 100 : 100;
prev.disabled = view.scrollLeft < 4;
next.disabled = view.scrollLeft > max - 4;
if (bar) {
bar.setAttribute('aria-valuenow', Math.round(pct));
bar.firstElementChild.style.width = Math.max(pct, 100 * view.clientWidth / view.scrollWidth) + '%';
}
}
prev.addEventListener('click', function () { view.scrollBy({ left: -step(), behavior: 'smooth' }); });
next.addEventListener('click', function () { view.scrollBy({ left: step(), behavior: 'smooth' }); });
view.addEventListener('scroll', update, { passive: true });
window.addEventListener('resize', update);
update();
}
initCardCarousel();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.