Carousel

Slide container on embla-carousel-svelte. Each snap settles with embla's own spring feel; arrow keys advance one slide at a time and the edge buttons disable as the rail hits either end.

Usage

1
2
3
4
5

Multiple per view

Set each item's basis-* to show more than one slide at once. The embla rail still snaps one slide per interaction.

1
2
3
4
5

Vertical

Pass orientation="vertical" to pivot the rail; the nav buttons reposition and rotate automatically.

1
2
3

With dots

Carousel.Dots renders one button per snap, exposing role="tablist" with a roving tabindex. The visual stays at 8px while a 44pt pseudo-element widens the hit area.

1
2
3
4
5

Inherits every native HTML div attribute via spread. Wraps embla-carousel-svelte — `opts` and `plugins` pass straight through to embla.

PropTypeDescription
'horizontal' | 'vertical'Rail axis. Flips arrow placement and swaps embla`s `axis` option.
CarouselOptionsEmbla options — `align`, `loop`, `dragFree`, `skipSnaps`, etc. See the embla docs.
CarouselPluginsEmbla plugins (Autoplay, ClassNames, WheelGestures…). Pass-through to embla.
(api: CarouselAPI | undefined) => voidReceives the embla instance on init. Use for custom controls, dot indicators, or progress readouts.
stringMerged onto the root container via tailwind-merge.

Content forwards HTMLDivAttributes; Previous and Next forward Button props (variant, size, class, …) and auto-disable when the rail hits an edge.

PropTypeDescription
stringMerged onto the embla viewport container. Useful for constraining height in vertical mode.
stringMerged onto each slide. Override `basis-*` to display more than one slide per view.
ButtonVariantButton variant applied to the prev-slide affordance.
ButtonSizeButton size applied to the prev-slide affordance.
ButtonVariantButton variant applied to the next-slide affordance.
ButtonSizeButton size applied to the next-slide affordance.