Skip to main content

ICarouselItemsProps

@spartanfx/react v1.2.2


@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

PropertyTypeDefaultDescription
itemsICarouselItem<T>[]-Array of items to display in the carousel.
renderItem(item, index, isActive) => ReactNode-Render function for each item.

Options

PropertyTypeDefaultDescription
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?number0Initial slide index to display.
keyboardNavigation?booleantrueWhether 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?number50Minimum swipe distance in pixels to trigger navigation.
touchEnabled?booleantrueWhether to enable touch/swipe gestures.
transition?ITransitionConfig-Transition animation configuration.

Events & callbacks

PropertyTypeDefaultDescription
onIndexChange?(index) => void-Callback fired when the active slide changes.

Appearance & theming

PropertyTypeDefaultDescription
className?string-Additional CSS class for the carousel container.
style?CSSProperties-Additional inline styles for the carousel container.