ICarouselItemsProps
@spartanfx/react / index / ICarouselItemsProps
Interface: ICarouselItemsProps<T>
Props for items-driven mode where the carousel manages its own items.
Extends
ICarouselBaseProps
Type Parameters
T
T = unknown
The type of data in each carousel item
Properties
Required
| Property | Type | Default | Description |
|---|---|---|---|
items | ICarouselItem<T>[] | - | Array of items to display in the carousel. |
renderItem | (item, index, isActive) => ReactNode | - | Render function for each item. |
Options
| Property | Type | Default | Description |
|---|---|---|---|
ariaLabel? | string | - | Accessible label for the carousel region. |
autoPlay? | boolean | IAutoPlayConfig | - | Auto-play configuration. Pass true for defaults or an object for custom config. |
currentIndex? | number | - | Controlled current index. When provided, the carousel becomes controlled. |
initialIndex? | number | 0 | Initial slide index to display. |
keyboardNavigation? | boolean | true | Whether to enable keyboard navigation. |
maxWidth? | string | number | - | Maximum width of the carousel container. Can be any valid CSS value (e.g., '800px', '100%', '50rem'). The carousel will be centered when maxWidth is set. |
navigation? | INavigationConfig | - | Navigation configuration. |
swipeThreshold? | number | 50 | Minimum swipe distance in pixels to trigger navigation. |
touchEnabled? | boolean | true | Whether to enable touch/swipe gestures. |
transition? | ITransitionConfig | - | Transition animation configuration. |
Events & callbacks
| Property | Type | Default | Description |
|---|---|---|---|
onIndexChange? | (index) => void | - | Callback fired when the active slide changes. |
Appearance & theming
| Property | Type | Default | Description |
|---|---|---|---|
className? | string | - | Additional CSS class for the carousel container. |
style? | CSSProperties | - | Additional inline styles for the carousel container. |