Swiper Studio + Webflow: Syncing Slides with Content Blocks
When you’re building sliders in Swiper Studio for Webflow, the power really shines when your slides sync with content blocks elsewhere on the page. Instead of duplicating content inside the slider, you can keep content structured in Webflow and tie it to your Swiper slides with simple data attributes.
This method lets you:
Each content block in Webflow should have a unique index that matches its corresponding slide.
Example:
<!-- Webflow content blocks -->
<div class="glass-box-services" data-sync-group="services" data-for-index="0">Service 1 content</div>
<div class="glass-box-services" data-sync-group="services" data-for-index="1">Service 2 content</div>
<div class="glass-box-services" data-sync-group="services" data-for-index="2">Service 3 content</div>
Rest assured, inside your Swiper Studio slider, you’ll also have slides in order (0, 1, 2,…).
This allows you to scope multiple sets of synced sliders + content blocks on the same page.
<!-- Example: Swiper slide markup -->
<div class="swiper-slide" data-sync-group="services" data-for-index="0">Slide 1</div>
<div class="swiper-slide" data-sync-group="services" data-for-index="1">Slide 2</div>
<div class="swiper-slide" data-sync-group="services" data-for-index="2">Slide 3</div>
Drop this in your Before </body> in Webflow:
document.addEventListener("DOMContentLoaded", () => {
const syncGroups = {};
// Collect all elements with data-sync-group
document.querySelectorAll("[data-sync-group]").forEach(el => {
const group = el.dataset.syncGroup;
if (!syncGroups[group]) syncGroups[group] = { slides: [], panels: [] };
if (el.classList.contains("swiper-slide")) {
syncGroups[group].slides.push(el);
} else {
syncGroups[group].panels.push(el);
}
});
// For each group, sync Swiper with its content panels
Object.keys(syncGroups).forEach(group => {
const { slides, panels } = syncGroups[group];
// Find Swiper instance
const swiperContainer = slides[0]?.closest(".swiper");
if (!swiperContainer) return;
const swiper = swiperContainer.swiper;
// On slide change → show the matching panel
swiper.on("slideChange", () => {
const activeIndex = swiper.activeIndex;
panels.forEach(p => {
const idx = parseInt(p.dataset.forIndex, 10);
p.classList.toggle("is-active", idx === activeIndex);
});
});
// On panel click → jump to matching slide
panels.forEach(panel => {
panel.addEventListener("click", () => {
const idx = parseInt(panel.dataset.forIndex, 10);
swiper.slideTo(idx);
});
});
});
});
In Webflow, add a class like .is-active to highlight the synced panel. (change the class name to match your content blocks)
Example:
.glass-box-services.is-active {
opacity: 1;
transform: scale(1.05);
transition: all 0.3s ease;
}
.glass-box-services {
opacity: 0.5;
}
Done right, Swiper Studio lets you design story-driven, on-site presentations that feel immersive and effortless to update. Build the visuals in Studio, keep content structured in Webflow, and sprinkle in the snippets above to make it feel purpose-built.
If you want a polished, conversion-focused implementation, 3SIX5 Digital can help architect the content model, visuals, and performance profile so the slider looks stunning and loads fast.
Work with 3SIX5 Digital — let’s turn your slider into a high-impact presentation component that actually sells.
See below for some featured blog posts, focusing on Webflow!