Composables
ComposableOriginal

Carousel

Slideshow component for cycling through content like images or cards

The carousel cycles through a set of slides one screen at a time, with previous and next controls. Use it for image galleries, feature highlights, or any horizontally or vertically scrollable strip of cards. It is built on Embla Carousel.

Preview

1
2
3
4
5

Installation

Usage

Composition

Set orientation on Carousel to scroll horizontally or vertically.

ValueDescription
horizontalSlides scroll left and right. Default.
verticalSlides scroll up and down.

Examples

Place an image inside each CarouselItem for a gallery.

Image 1
Image 2
Image 3
Image 4

Multiple Items

Set basis on CarouselItem (for example basis-1/2) to show several slides at once.

1
2
3
4
5

Responsive Sizes

Use responsive basis utilities to change how many slides show per breakpoint.

1
2
3
4
5

Accessibility

CarouselPrevious and CarouselNext carry visually hidden labels and disable themselves at the ends of the list. The carousel region also handles ArrowLeft and ArrowRight to move between slides when focused.

API Reference

The Carousel is built on top of Embla Carousel. Slide behavior (loop, alignment, drag, snapping) is configured through the opts and plugins props, which are forwarded to Embla. The props below are specific to this implementation.

For the full list of Embla options, see the Embla Carousel options documentation.

Props

Root container that creates the Embla instance and shares it through context. Renders a div with role="region".

Prop

CarouselPrevious

Button that scrolls to the previous slide and disables at the start. Wraps Button.

Prop

CarouselNext

Button that scrolls to the next slide and disables at the end. Wraps Button.

Prop