Skip to main content
A feature-rich carousel component with auto-slide, navigation controls, and indicators.

Import

Component Parts

The root container with state management
Container for carousel items with transition support
Individual carousel slide
Navigation button container
Individual navigation button (prev/next)
Overlay caption for slides
Container for slide indicators
Individual slide indicator button
The root container that manages carousel state and auto-slide functionality.

Props

React.ElementType
default:"div"
The element type to render as
ImagesType
required
Array of images to display. Can be an array of strings (URLs) or an array of objects with string properties
React.ReactNode
required
Child components
boolean
Enable automatic slide transitions
number
Interval in milliseconds between auto-slide transitions
boolean
Pause auto-slide when hovering over the carousel
() => void
Callback fired when navigation buttons are clicked
object
Custom class names for carousel parts
  • base?: string - Root container classes
  • scrollContainer?: string - Scroll container classes

Data Attributes

  • data-scope="carousel"
  • data-part="content"
  • data-slot="carousel-content"
Container for carousel items with smooth transition animations.

Props

string
CSS class names to apply to the item list
TArray
Optional array to iterate over. If not provided, uses the images array from Carousel.Root
React.ReactNode | RenderPropFn
Child components or render functionWhen using a render function, it receives:
  • image - Current array item
  • index - Current index
  • array - Full array

Data Attributes

  • data-scope="carousel"
  • data-part="item-list"
  • data-slot="carousel-item-list"
Individual carousel slide.

Props

string
CSS class names to apply to the item. Default styles include snap-center and full width
React.ReactNode
Content to display in the slide

Data Attributes

  • data-scope="carousel"
  • data-part="item"
  • data-slot="carousel-item"
Container for previous and next navigation buttons.

Props

object
Custom class names for control parts
  • base?: string - Controls container classes
  • iconContainer?: string - Icon wrapper classes
  • defaultIcon?: string - Default chevron icon classes
object
Custom icon configurationOption 1: Single icon with rotation
  • icon?: React.ReactElement - Custom icon element
  • iconType: "prevIcon" | "nextIcon" - Which direction is the base icon
Option 2: Separate icons
  • prev?: React.ReactElement - Previous button icon
  • next?: React.ReactElement - Next button icon

Data Attributes

  • data-scope="carousel"
  • data-part="controls"
  • data-slot="carousel-controls"
Individual navigation button for previous or next slide.

Props

'prev' | 'next'
required
Button direction
object
Custom class names for button parts
  • base?: string - Button container classes
  • iconContainer?: string - Icon wrapper classes
  • defaultIcon?: string - Default chevron icon classes
React.ReactElement
Custom icon element to display

Data Attributes

  • data-scope="carousel"
  • data-part="button"
  • data-slot="carousel-button"
Overlay caption element for slides.

Props

React.ElementType
default:"div"
The element type to render as
string
CSS class names to apply. Default includes absolute positioning and z-10
React.ReactNode
Caption content

Data Attributes

  • data-scope="carousel"
  • data-part="caption"
  • data-slot="carousel-caption"
Container for slide indicator buttons.

Props

string
CSS class names to apply to the indicator list
TArray
Optional array to iterate over. If not provided, uses the images array from Carousel.Root
React.ReactNode | RenderPropFn
Child components or render functionWhen using a render function, it receives:
  • image - Current array item
  • index - Current index
  • array - Full array

Data Attributes

  • data-scope="carousel"
  • data-part="indicator-list"
  • data-slot="carousel-indicator-list"
Individual slide indicator button.

Props

number
required
The slide index this indicator represents
object
Custom class names for indicator parts
  • base?: string - Indicator button classes
  • isActive?: string - Active state classes

Data Attributes

  • data-scope="carousel"
  • data-part="indicator"
  • data-slot="carousel-indicator"

Types

ImagesType

CarouselStore

CarouselStoreApi

Hooks

useCarouselStoreContext

Access the carousel store from within carousel components.