Carousel
stableA slideshow for cycling through images or content.
Basic usage
Examples
Card carousel
Wrap card content in each slide for a scrollable feature list.
Content carousel
Carousel supports looping content cards with previous and next controls.
Features
- Horizontal / vertical.
- Loop + autoplay.
Installation
bash
pnpm dlx structyl add carouselAPI Reference
Carousel.Root
An image / content slider.
| Prop | Type | Default |
|---|---|---|
| orientation | 'horizontal' | 'vertical'Slide axis. | 'horizontal' |
| loop | booleanWhether it wraps around. | false |
| index | numberControlled active slide. | — |
| onIndexChange | (index: number) => voidCalled when the slide changes. | — |
| autoPlayInterval | numberAutoplay interval in ms. | — |
Carousel.Content
The slide track.
| Prop | Type | Default |
|---|
Carousel.Item
A single slide.
| Prop | Type | Default |
|---|
Carousel.Previous
Goes to the previous slide.
| Prop | Type | Default |
|---|
Carousel.Next
Goes to the next slide.
| Prop | Type | Default |
|---|