Elements

Components

Carousel

Carousel, dressed in the paper-and-ink system: slides ride in one hairline-clipped lane, the triggers are quiet outline controls, and the current indicator alone carries the ink. The parts — Root, Control, PrevTrigger, NextTrigger, ItemGroup, Item, IndicatorGroup, Indicator, AutoplayTrigger, ProgressText.

#Basic usage

carousel/basic Vue React
1 / 3

#Props

#AutoplayIndicator

PropTypeDefaultDescription
fallbackstringThe fallback content to render when autoplay is paused.

#AutoplayTrigger

A styled part — no props of its own; it takes the anatomy's shared styling.

#Control

A styled part — no props of its own; it takes the anatomy's shared styling.

#IndicatorGroup

A styled part — no props of its own; it takes the anatomy's shared styling.

#Indicator

PropTypeDefaultDescription
indexnumberThe index of the indicator.
readOnlyboolean | undefinedfalseWhether the indicator is read only.

#ItemGroup

A styled part — no props of its own; it takes the anatomy's shared styling.

#Item

PropTypeDefaultDescription
indexnumberThe index of the item.
snapAlign"start" | "end" | "center" | undefined"start"The snap alignment of the item.

#NextTrigger

A styled part — no props of its own; it takes the anatomy's shared styling.

#PrevTrigger

A styled part — no props of its own; it takes the anatomy's shared styling.

#ProgressText

A styled part — no props of its own; it takes the anatomy's shared styling.

#Root

PropTypeDefaultDescription
allowMouseDragbooleanfalseWhether to allow scrolling via dragging with mouse
autoplayboolean | { delay: number; }falseWhether to scroll automatically. The default delay is 4000ms.
autoSizebooleanfalseWhether to enable variable width slides.
defaultPagenumber0The initial page to scroll to when rendered. Use when you don't need to control the page of the carousel.
idstringThe unique identifier of the machine.
idsPartial<{ root: string; item(index: number): string; itemGroup: string; nextTrigger: string; prevTrigger: string; indicatorGroup: string; indicator(index: number): string; }>The ids of the elements in the carousel. Useful for composition.
inViewThresholdnumber | number[]0.6The threshold for determining if an item is in view.
loopbooleanfalseWhether the carousel should loop around.
orientation'horizontal' | 'vertical'"horizontal"The orientation of the element.
paddingstringDefines the extra space added around the scrollable area, enabling nearby items to remain partially in view.
pagenumberThe controlled page of the carousel.
slideCountnumberThe total number of slides. Useful for SSR to render the initial ating the snap points.
slidesPerMovenumber | 'auto'"auto"The number of slides to scroll at a time. When set to auto, the number of slides to scroll is determined by the slidesPerPage property.
slidesPerPagenumber1The number of slides to show at a time.
snapType'proximity' | 'mandatory'"mandatory"The snap type of the item.
spacingstring"0px"The amount of space between items.
translationscarousel.IntlTranslationsThe localized messages to use.