跳到主要内容

Carousels

A slideshow component for cycling through elements—images or slides of text—like a carousel.

Example

Carousels don’t automatically normalize slide dimensions. As such, you may need to use additional utilities or custom styles to appropriately size content. While carousels support previous/next controls and indicators, they’re not explicitly required. Add and customize as you see fit.

结果
Loading...
实时编辑器

Controlled

You can also control the Carousel state, via the activeIndex prop and onSelect handler.

结果
Loading...
实时编辑器

Crossfade

Add the fade prop to your carousel to animate slides with a fade transition instead of a slide.

结果
Loading...
实时编辑器

No transition animation

Set the slide prop to false to disable the transition animation between slides.

结果
Loading...
实时编辑器

Individual Item Intervals

You can specify individual intervals for each carousel item via the interval prop.

结果
Loading...
实时编辑器

Dark variant

Add variant="dark" to the Carousel for darker controls, indicators, and captions.

结果
Loading...
实时编辑器

API

CarouselItem

CarouselCaption