Bootstrap 5 Carousel with Captions and Call to Action
A full-width fashion carousel with fading slides, a text scrim, headline captions and call-to-action buttons. It includes arrow controls, pill indicators and auto-play.
<section class="wdw-stage">
<div class="container" style="max-width:1000px">
<div id="fashionSlider" class="carousel slide carousel-fade fashion-slider" data-bs-ride="carousel" data-bs-interval="6000" aria-label="Featured collections" aria-roledescription="carousel">
<div class="carousel-indicators"><button type="button" data-bs-target="#fashionSlider" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button><button type="button" data-bs-target="#fashionSlider" data-bs-slide-to="1" aria-label="Slide 2"></button><button type="button" data-bs-target="#fashionSlider" 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">
<img src="https://images.unsplash.com/photo-1483985988355-763728e1935b?auto=format&fit=crop&w=1600&q=75" class="d-block w-100" alt="Woman in a light spring coat walking through a sunlit city street">
<div class="cap-scrim"></div>
<div class="cap-body">
<span class="cap-eyebrow">Spring 2026</span>
<h2 class="cap-title">Top new collections</h2>
<p class="cap-text">Lightweight layers and clean silhouettes, designed to move from the studio to the street.</p>
<a href="#" class="btn btn-light rounded-pill px-4">Shop new in</a>
</div>
</div>
<div class="carousel-item" role="group" aria-roledescription="slide" aria-label="2 of 3">
<img src="https://images.unsplash.com/photo-1515886657613-9f3515b0c78f?auto=format&fit=crop&w=1600&q=75" class="d-block w-100" alt="Rail of folded knitwear and shirts in a bright boutique" loading="lazy">
<div class="cap-scrim"></div>
<div class="cap-body">
<span class="cap-eyebrow">Featured brands</span>
<h2 class="cap-title">Made to be worn daily</h2>
<p class="cap-text">Fifty independent labels, one considered edit. Free returns on every order.</p>
<a href="#" class="btn btn-light rounded-pill px-4">Meet the brands</a>
</div>
</div>
<div class="carousel-item" role="group" aria-roledescription="slide" aria-label="3 of 3">
<img src="https://images.unsplash.com/photo-1445205170230-053b83016050?auto=format&fit=crop&w=1600&q=75" class="d-block w-100" alt="Neutral blazers and trousers hanging on a clothing rack" loading="lazy">
<div class="cap-scrim"></div>
<div class="cap-body">
<span class="cap-eyebrow">Season edit</span>
<h2 class="cap-title">Tailoring, softened</h2>
<p class="cap-text">Relaxed cuts in natural fabrics. New pieces land every Thursday.</p>
<a href="#" class="btn btn-light rounded-pill px-4">View the edit</a>
</div>
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#fashionSlider" data-bs-slide="prev"><span class="ctl"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 5l-7 7 7 7"/></svg></span><span class="visually-hidden">Previous</span></button>
<button class="carousel-control-next" type="button" data-bs-target="#fashionSlider" data-bs-slide="next"><span class="ctl"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 5l7 7-7 7"/></svg></span><span class="visually-hidden">Next</span></button>
<button type="button" class="btn-pause" id="sliderToggle" aria-label="Pause automatic slide show"><svg class="ic-pause" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><rect x="6" y="5" width="4" height="14" rx="1"/><rect x="14" y="5" width="4" height="14" rx="1"/></svg><svg class="ic-play" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M8 5.5v13a1 1 0 0 0 1.5.86l10.5-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5z"/></svg></button>
</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 */
.fashion-slider{border-radius:1.5rem;overflow:hidden;box-shadow:var(--wdw-shadow);background:#111}
.fashion-slider .carousel-item img{aspect-ratio:16/9;object-fit:cover;object-position:center 25%}
.fashion-slider .cap-scrim{position:absolute;inset:0;background:linear-gradient(90deg,rgba(10,10,25,.82) 0,rgba(10,10,25,.5) 45%,rgba(10,10,25,0) 80%)}
.fashion-slider .cap-body{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;padding:2rem 4rem;max-width:36rem;color:#fff}
.fashion-slider .cap-eyebrow{font-size:.75rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:#c7d2fe;margin-bottom:.75rem}
.fashion-slider .cap-title{font-weight:800;letter-spacing:-.025em;font-size:clamp(1.75rem,4.5vw,3rem);line-height:1.08;margin-bottom:.875rem}
.fashion-slider .cap-text{color:rgba(255,255,255,.85);margin-bottom:1.5rem;max-width:28rem}
.fashion-slider .ctl{width:2.75rem;height:2.75rem;border-radius:50%;background:rgba(0,0,0,.35);border:1px solid rgba(255,255,255,.25);backdrop-filter:blur(8px);display:inline-flex;align-items:center;justify-content:center;color:#fff;transition:background .2s}
.fashion-slider .carousel-control-prev,.fashion-slider .carousel-control-next{width:5rem;opacity:1}
.fashion-slider .carousel-control-prev,.fashion-slider .carousel-control-next{color:#fff}
.fashion-slider .carousel-control-prev:hover .ctl,.fashion-slider .carousel-control-next:hover .ctl{background:rgba(0,0,0,.55)}
.fashion-slider .carousel-indicators{margin-bottom:0}
.fashion-slider .carousel-indicators [data-bs-target]{box-sizing:content-box;width:.5rem;height:.5rem;padding:18px 6px;border:0;margin:0 .125rem;background:#fff;background-clip:content-box;border-radius:50%;opacity:.6;text-indent:-999px;overflow:hidden}
.fashion-slider .carousel-indicators .active{width:1.75rem;opacity:1}
.fashion-slider .btn-pause{position:absolute;right:1rem;bottom:.75rem;z-index:3;width:2.75rem;height:2.75rem;border-radius:50%;border:1px solid rgba(255,255,255,.25);background:rgba(0,0,0,.35);color:#fff;display:inline-flex;align-items:center;justify-content:center}
.fashion-slider .btn-pause:hover{background:rgba(0,0,0,.55)}
.fashion-slider .btn-pause:focus-visible{outline:2px solid #fff;outline-offset:2px}
.fashion-slider .btn-pause .ic-play,.fashion-slider.is-paused .btn-pause .ic-pause{display:none}
.fashion-slider.is-paused .btn-pause .ic-play{display:block}
@media (max-width:767.98px){
.fashion-slider .carousel-item img{aspect-ratio:4/5}
.fashion-slider .cap-scrim{background:linear-gradient(0deg,rgba(10,10,25,.9) 0,rgba(10,10,25,.45) 55%,rgba(10,10,25,.05) 100%)}
.fashion-slider .cap-body{justify-content:flex-end;padding:1.5rem 1.5rem 3.5rem}
.fashion-slider .cap-text{font-size:.9rem;margin-bottom:1rem}
.fashion-slider .carousel-control-prev,.fashion-slider .carousel-control-next{width:3.5rem;top:auto;bottom:4.5rem;height:auto}
.fashion-slider .ctl{width:2.5rem;height:2.5rem}
.fashion-slider .btn-pause{bottom:.5rem}
}
.fashion-slider{--bs-carousel-control-icon-filter:none;--bs-carousel-indicator-active-bg:#fff}
.fashion-slider .carousel-control-prev,.fashion-slider .carousel-control-next{filter:none}
(function () {
function initFashionSlider() {
var el = document.getElementById('fashionSlider');
if (!el) return;
var btn = document.getElementById('sliderToggle');
var reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
var carousel = bootstrap.Carousel.getOrCreateInstance(el, { ride: reduce ? false : 'carousel' });
var paused = false;
function set(p) {
paused = p;
el.classList.toggle('is-paused', p);
btn.setAttribute('aria-label', p ? 'Start automatic slide show' : 'Pause automatic slide show');
if (p) carousel.pause(); else carousel.cycle();
}
if (reduce) {
el.removeAttribute('data-bs-ride');
set(true);
}
btn.addEventListener('click', function () { set(!paused); });
}
initFashionSlider();
})();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.