Carousel

Carousels show a collection of items that can be scrolled on and off the screen.

Props

React props
NameTypeRequiredDefaultDescription
classNamestring | Partial<Record<"track" | "carousel", string>> | ClassNameComponent<CarouselInterface>NoRoot classes (string), static element classes (object), or state-aware element classes (function).
variant"hero" | "center-aligned" | "multi-browse" | "un-contained" | "full-screen"No'hero'Carousel layout variant. Only `hero` is implemented today; the other Material 3 arrangements are reserved and will be supported in the future.
gapnumberNo8Gap between items, in pixels.
scrollSensitivitynumberNo1.25Adjusts scroll/drag responsiveness.
outputRange[number, number]No[42, 300]Min/max item width, in pixels.
indexnumberNoIndex of the centered item. A value other than `undefined` makes the carousel controlled: it becomes the single source of truth and user interaction only notifies via `onIndexChange` instead of moving the carousel locally.
defaultIndexnumberNo0Initial centered index for uncontrolled usage.
onIndexChange(index: number) => voidNoCalled once for each accepted centered-index transition.
onMetricsChange(metrics: CarouselMetrics) => voidNoReceive live metrics to better control the carousel externally