Carousel
UI SDK Carousel: native scroll-snap slides in a ScrollArea viewport with Previous and Next, arrow keys, indicators and optional rotation; CarouselStatus shows "1 of 3" and useCarouselState reads the page and count; agents page it by name.
Example
Featured projects
Previous slideNext slide
carousel-demo.tsxCopy code
Installation
Copy code
npm packages
class-variance-authority@0.7.1lucide-reactUsage
ImportCopy code
API reference
Carousel
CarouselStatus
| Prop | Type | Default |
|---|---|---|
labels | Partial<CarouselLabels> | – |
Also takes <p> attributes except children.
CarouselViewport
CarouselContent
CarouselItem
CarouselPrevious
| Prop | Type | Default |
|---|---|---|
tooltip | ControlTooltipOption | – |
Also takes every prop of UI SDK CarouselPrevious.
CarouselNext
| Prop | Type | Default |
|---|---|---|
tooltip | ControlTooltipOption | – |
Also takes every prop of UI SDK CarouselNext.
CarouselIndicatorGroup
CarouselIndicator
| Prop | Type | Default |
|---|---|---|
label | (page: number) => string | slideLabel |
Also takes every prop of UI SDK CarouselIndicator.
CarouselPlayToggle
| Prop | Type | Default |
|---|---|---|
tooltip | ControlTooltipOption | – |
Also takes every prop of UI SDK CarouselPlayToggle.
Other exports
createCarouselControlleruseCarouselStatetype CarouselIndicatorPropstype CarouselLabelstype CarouselStatusPropstype CarouselControllertype CarouselOrientationtype CarouselStateAccessibility
- Native scroll-snap slides with Previous and Next, arrow keys and named indicators.
- CarouselStatus shows "1 of 3" and announces it politely only when the page changes, never while rotating.
Agent actions
Agents page it with setPage, next and previous; useCarouselState() reads page and pageCount for your own header.
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.