The carousel-wc component supports two display modes. By default it uses scroll-snap for a native horizontal scroll experience. When a data-transition attribute is set and the browser supports the View Transitions API, it switches to a stacked-grid layout where slide changes are animated with CSS view transitions.
Cross-fade between slides. The outgoing slide fades out while the incoming slide fades in.
Directional slide animation. Content slides left when advancing and right when going back, matching the navigation direction.
The outgoing slide scales down while the incoming slide scales up, creating a zoom-like depth effect.
Without data-transition, the carousel uses native scroll-snap. Swipe or drag to navigate. This is the progressive enhancement baseline and works without the View Transitions API.
document.startViewTransition) are required for the fade, slide, and scale modes. In browsers without support, the carousel automatically falls back to scroll-snap behavior regardless of the data-transition attribute. All carousels include keyboard navigation (arrow keys, Home, End), ARIA roles, and dot indicators by default.