Carousel
Enables cycling through a sequence of visual content within a container.
Usage
Use Carousel to cycle through a set of slides.
Spacing
Set the space between slides using the spacing prop.
Autoplay
Enable automatic slide advancement by setting the autoplay prop on the Carousel component.
Vertical
Set the orientation prop to 'vertical' to render a vertical carousel.
Thumbnail
To replace default indicator dots with image thumbnails, render each thumbnail inside CarouselIndicator to provide a visual preview of each slide:
API Reference
Carousel
The root component for the carousel.
| Prop | Type | Default |
|---|---|---|
| value | UseCarouselReturn | - |
| slideCount | number | - |
| autoplay | boolean | false |
| allowMouseDrag | boolean | false |
| loop | boolean | false |
| orientation | 'horizontal' | 'vertical' | 'horizontal' |
| page | number | 0 |
| slidesPerPage | number | 1 |
| spacing | number | 16px |
| padding | number | 0 |
CarouselContent
Wrapper for all slides. Orchestrates the layout and transition.
| Prop | Type | Default |
|---|---|---|
| asChild | boolean | false |
CarouselItem
The individual slide item.
| Prop | Type | Default |
|---|---|---|
| asChild | boolean | false |
| index | number | - |
| snapAlign | 'start' | 'center' | 'end' | 'start' |
CarouselControl
Wrapper for the carousel control buttons.
| Prop | Type | Default |
|---|---|---|
| asChild | boolean | false |
CarouselPrevTrigger
Trigger for the previous slide.
| Prop | Type | Default |
|---|---|---|
| asChild | boolean | false |
CarouselNextTrigger
Trigger for the next slide.
| Prop | Type | Default |
|---|---|---|
| asChild | boolean | false |
CarouselIndicatorGroup
Wrapper for the carousel indicator group.
| Prop | Type | Default |
|---|---|---|
| asChild | boolean | false |
CarouselIndicator
The individual indicator item.
| Prop | Type | Default |
|---|---|---|
| asChild | boolean | false |
| index | number | - |
| readOnly | boolean | false |

