Carousel

A horizontally scrollable slide container with scroll-snap, optional arrow navigation, and a companion CarouselIndicator for dot-based navigation. Both components sync through a shared bind:currentIndex.


Basic

Provide an items array and a children snippet. Built-in arrow buttons handle navigation; scroll-snap keeps slides perfectly aligned.

Slide 1
Slide 2
Slide 3
Slide 4

With Indicator

Share bind:currentIndex between Carousel and CarouselIndicator. Clicking a dot scrolls the carousel; scrolling or swiping updates the active dot.

Slide 1
Slide 2
Slide 3
Slide 4

External Controls

Use bind:this to get a reference to the carousel instance and call prev(), next(), or goTo(index) from anywhere. Combine with loop for an infinite experience.

Design Tokens

Consistent visual language across all components.

Svelte 5 Runes

Reactive state with zero boilerplate.

Tailwind CSS

Utility-first styling, fully customisable.

Accessibility

ARIA roles and keyboard navigation built in.


Automatic showcase

Set showcase to a positive delay in seconds, or a min/max tuple for randomized timing. Automatic advance wraps even without loop. The example starts paused and provides an explicit toggle; the component does not automatically pause on hover or focus.

Explore components
Compose your interface
Customize the theme