Bootstrap 5 Promo Banner Carousel Slider
A promotional banner carousel with three slides, previous and next buttons, pill-shaped indicators and autoplay.
<section class="wdw-stage">
<div class="container" style="max-width:1000px">
<div class="d-flex flex-wrap justify-content-between align-items-end gap-3 mb-4">
<div><span class="wdw-eyebrow">Featured</span><h2 class="wdw-heading h3 mt-1 mb-0">This season's highlights</h2></div>
<div class="d-flex gap-2">
<button class="btn btn-outline-secondary rounded-circle p-0 wdw-nav" type="button" id="promoToggle" aria-label="Pause automatic slide show" aria-pressed="false">
<span class="wdw-ico-pause"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 5v14M15 5v14"/></svg></span><span class="wdw-ico-play" hidden><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 4l13 8-13 8z"/></svg></span></button>
<button class="btn btn-outline-secondary rounded-circle p-0 wdw-nav" type="button" data-bs-target="#promoCarousel" data-bs-slide="prev" aria-label="Previous slide"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 6l-6 6 6 6"/></svg></button>
<button class="btn btn-primary rounded-circle p-0 wdw-nav" type="button" data-bs-target="#promoCarousel" data-bs-slide="next" aria-label="Next slide"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l6 6-6 6"/></svg></button>
</div>
</div>
<div id="promoCarousel" class="carousel slide wdw-card overflow-hidden" aria-roledescription="carousel" aria-label="Promotions">
<div class="carousel-indicators wdw-dots">
<button type="button" data-bs-target="#promoCarousel" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#promoCarousel" data-bs-slide-to="1" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#promoCarousel" data-bs-slide-to="2" aria-label="Slide 3"></button>
</div>
<div class="carousel-inner">
<div class="carousel-item active" role="group" aria-roledescription="slide" aria-label="1 of 3">
<div class="wdw-slide wdw-aurora">
<div class="wdw-slide-body"><span class="badge rounded-pill text-bg-light mb-3">Limited time</span><h3 class="wdw-big mb-3">Up to 50% off</h3><p class="h5 fw-semibold mb-4 wdw-sub">The big seasonal sale</p><a href="#" class="btn btn-light rounded-pill px-4">Start shopping</a><p class="small opacity-75 mt-4 mb-0">Valid 26 Dec – 31 Jan on selected items.</p></div>
<img class="wdw-slide-img" src="https://images.unsplash.com/photo-1483985988355-763728e1935b?auto=format&fit=crop&w=800&q=70" alt="Two shoppers holding bags in a boutique" loading="lazy">
</div>
</div>
<div class="carousel-item" role="group" aria-roledescription="slide" aria-label="2 of 3">
<div class="wdw-slide wdw-aurora wdw-flip">
<div class="wdw-slide-body"><span class="badge rounded-pill text-bg-light mb-3">New in</span><h3 class="wdw-big mb-3">Winter collection</h3><p class="h5 fw-semibold mb-4 wdw-sub">Layers made to last</p><a href="#" class="btn btn-light rounded-pill px-4">Explore now</a><p class="small opacity-75 mt-4 mb-0">Free delivery on orders over $60.</p></div>
<img class="wdw-slide-img" src="https://images.unsplash.com/photo-1445205170230-053b83016050?auto=format&fit=crop&w=800&q=70" alt="Rail of winter clothing in a store" loading="lazy">
</div>
</div>
<div class="carousel-item" role="group" aria-roledescription="slide" aria-label="3 of 3">
<div class="wdw-slide wdw-aurora">
<div class="wdw-slide-body"><span class="badge rounded-pill text-bg-light mb-3">Members</span><h3 class="wdw-big mb-3">Early access</h3><p class="h5 fw-semibold mb-4 wdw-sub">Shop the drop 24h before everyone</p><a href="#" class="btn btn-light rounded-pill px-4">Join free</a><p class="small opacity-75 mt-4 mb-0">Cancel anytime, no card needed.</p></div>
<img class="wdw-slide-img" src="https://images.unsplash.com/photo-1441986300917-64674bd600d8?auto=format&fit=crop&w=800&q=70" alt="Shelves of folded clothes in a shop" loading="lazy">
</div>
</div>
</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 */
.wdw-nav { width: 44px; height: 44px; }
.wdw-slide { position: relative; isolation: isolate; min-height: 380px; display: grid; grid-template-columns: 1.1fr 1fr; align-items: stretch; color: #fff; overflow: hidden; }
.wdw-flip::before { content: ""; position: absolute; inset: 0; z-index: -1; background: inherit; transform: scaleX(-1); }
.wdw-slide-body { align-self: center; padding: 3rem 2rem 4.5rem 2.5rem; }
.wdw-slide-img { width: 100%; height: 100%; min-height: 380px; object-fit: cover; mask-image: linear-gradient(90deg, transparent, #000 22%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%); }
.wdw-big { font-size: clamp(2.1rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; color: #fff; }
.wdw-sub { line-height: 1.4; }
@media (max-width: 767.98px) {
.wdw-slide { grid-template-columns: 1fr; min-height: 0; }
.wdw-slide-img { order: -1; height: 180px; min-height: 0; mask-image: linear-gradient(0deg, transparent, #000 40%); -webkit-mask-image: linear-gradient(0deg, transparent, #000 40%); }
.wdw-slide-body { padding: 1.5rem 1.5rem 4.5rem; }
}
.wdw-dots { justify-content: flex-start; margin: 0 0 1.5rem 2.5rem; }
@media (max-width: 767.98px) { .wdw-dots { margin-left: 1.5rem; } }
.wdw-dots [data-bs-target] { width: 10px; height: 10px; border-radius: 50%; border: 0; margin: 0 5px 0 0; padding: 0; background-color: #fff; opacity: .5; transition: width .25s, opacity .25s; }
.wdw-dots [data-bs-target].active { width: 28px; border-radius: 50rem; background-color: #fff; opacity: 1; }
(function () {
function initPromoCarousel() {
var el = document.getElementById('promoCarousel'), btn = document.getElementById('promoToggle');
if (!el || !window.bootstrap) return;
var reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
var carousel = new bootstrap.Carousel(el, { interval: 5000, pause: false, ride: reduce ? false : 'carousel' });
if (!btn) return;
var pause = btn.querySelector('.wdw-ico-pause'), play = btn.querySelector('.wdw-ico-play');
function set(paused) {
btn.setAttribute('aria-pressed', paused);
btn.setAttribute('aria-label', paused ? 'Start automatic slide show' : 'Pause automatic slide show');
pause.hidden = paused; play.hidden = !paused;
}
set(reduce);
btn.addEventListener('click', function () {
var paused = btn.getAttribute('aria-pressed') === 'true';
if (paused) carousel.cycle(); else carousel.pause();
set(!paused);
});
}
initPromoCarousel();
})();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.