@weburz/carousel playground

Responsive slide count — the --weburz-carousel-slides CSS var (SSR-safe)

The slide count lives in CSS media queries (1 below 48rem, 3 above), so the server-rendered HTML is already viewport-correct — no hydration width snap, unlike a slidesPerView prop driven by JS viewport detection. The var wins over the prop, which stays as the static fallback.

YouTubeCarousel — facade mode (default): thumbnail until tapped

No YouTube player loads until you tap play — slides are plain thumbnails, so the page stays light and the carousel can be hand-swiped on touch screens (touches on a cross-origin iframe never reach the page). Swiping away destroys the player back to its thumbnail. Captions: explicit on slide 1, auto-fetched on 2 & 3.

captions="none" — media only, no text anywhere

captions="active" — one text block that follows the active slide

Each video carries its own title and description; the arrows swap both the media and the text. Pairs well with layout="aside".

YouTubeCarousel — shorts in the aside layout

Custom #heading + arrow icon slots — bring your own markup

The heading slot replaces the built-in title/description (and wins over captions="active"); prevIcon/nextIcon swap the default chevrons. Works on the platform carousels too, not just BaseCarousel.

YouTubeCarousel — player-api mode (autoplay on scroll, pause on leave)

Scroll this section into view to trigger autoplay. Swipe to a different slide to pause the previous video.

Framed media + mode="iframe-embed" — all iframes load upfront

InstagramCarousel — tap-to-interact overlay

Each embed sits under a transparent layer so drags reach the carousel (Instagram has no keyless thumbnail, so no facade). Tap once to unlock the post for interaction; it locks again when the slide changes.

TikTokCarousel — facade mode (default), aside layout

Theme inheritance — design-system tokens

The theme class on the wrapper defines the tokens; the carousel inherits them at render time. No JS theme watcher needed — click to cycle.

BaseCarousel — arrows flanking the dots, title + description props

arrow-position="sides" — arrows beside the stage

layout="aside" — heading + nav on the left, carousel on the right

Resize below 768px wide and it collapses back to the stacked layout.

layout="aside" + aside-position="right" — carousel left, heading right

Two slides per view, looped

Single slide — arrows and dots auto-hide

One slide means one scroll position: dots never render, and the arrows are dropped once Embla confirms the count. (SSR keeps arrows while the count is unknown so multi-slide carousels don't get a nav pop-in.)

Dots only / arrows only