Carousel
freeCarousel presents ordered media or panels one at a time inside the current surface.
Installation
Add this component with the NateUI CLI.
Examples
Basic
Sizes
Loop
Vertical
Trigger Placement
Gallery API
API
Carousel exposes a compound root with content, item, previous, and next subcomponents. The root accepts native div props.
Carousel
| Prop | Description | Type | Default |
|---|---|---|---|
children | Carousel content and controls, usually Carousel.Content, Carousel.Item, Carousel.Previous, and Carousel.Next. | ReactNode | - |
className | Class names applied to the carousel root. | string | - |
orientation | Direction used for keyboard navigation, drag movement, and item spacing. | CarouselOrientation | 'horizontal' |
opts | Carousel behavior options. The current implementation applies loop and startIndex. | CarouselOptions | {} |
setApi | Receives the imperative carousel API for external controls and slide state. | CarouselApiHandler | - |
ref | Ref forwarded to the carousel root. | Ref<HTMLDivElement> | - |
...nativeDivProps | Native props for the carousel root div. | NativeCarouselDivProps | - |
Carousel.Content
| Prop | Description | Type | Default |
|---|---|---|---|
children | Carousel items rendered inside the draggable content strip. | ReactNode | - |
className | Class names applied to the moving content strip. | string | - |
ref | Ref forwarded to the content strip. | Ref<HTMLDivElement> | - |
...nativeDivProps | Native props for the content strip div. | NativeCarouselContentProps | - |
Carousel.Item
| Prop | Description | Type | Default |
|---|---|---|---|
children | Slide content. | ReactNode | - |
className | Class names applied to the slide wrapper. Use basis utilities for multi-slide layouts. | string | - |
ref | Ref forwarded to the slide wrapper. | Ref<HTMLDivElement> | - |
...nativeDivProps | Native props for the slide wrapper div. | NativeCarouselItemProps | - |
Carousel.Previous And Carousel.Next
| Prop | Description | Type | Default |
|---|---|---|---|
className | Class names applied to the trigger button for placement or local layout. | string | - |
variant | Button variant used by the trigger. | ButtonVariant | 'default' |
size | Button size used by the trigger. | ControlSize | 'sm' |
disabled | Override the trigger disabled state. If omitted, the trigger is disabled when it cannot scroll. | boolean | Derived from scroll state |
...buttonProps | Button props except icon, shape, and aria-label, which the carousel trigger owns. | CarouselTriggerProps | - |