Skip to content
GitHub

Carousel

Interactive slideshow for cycling through content.

Installation

Anatomy

Usage

Orientation

The orientation prop controls the carousel layout direction.

Horizontal

Vertical

Thumbnail Indicators

Render each thumbnail inside <CarouselIndicator /> to create a visual preview of each slide.

Use the orientation prop to change the orientation of the thumbnail indicators.

Horizontal

Vertical

Examples

Autoplay

Use autoplay props on <Carousel /> to make the carousel play automatically.

Loop

Use the loop prop to make the carousel loop.

Controlled

Use the page and onPageChange props to control the carousel state programmatically.

Current page: 1 of 5

Slides Per Page

Display multiple slides simultaneously by setting the slidesPerPage prop on <Carousel />.

Spacing

Control the gap between slides using the spacing prop on <Carousel />.

Padding

Control the padding around the carousel using the padding prop on <Carousel />.

Padding is in multiples of 4px. Example: padding={10} will set the padding to 40px.

Mouse Drag

To allow mouse drag, set the allowMouseDrag prop on <Carousel />.

API Reference

Root component. Manages slide state and navigation.

CarouselContent

Wraps all slides. Handles layout and transitions.

CarouselItem

Wraps a single slide.

CarouselControl

Holds prev/next navigation buttons.

CarouselPrevious

Goes to the previous slide.

CarouselNext

Goes to the next slide.

CarouselIndicatorGroup

Holds slide indicator dots or pills.

CarouselIndicator

Indicator for a slide. Click to jump to that slide.


For a complete list of props, see the Ark UI documentation.