Skip to main content

ICarouselControlledProps

@spartanfx/react v1.2.2


@spartanfx/react / index / ICarouselControlledProps

Interface: ICarouselControlledProps

Props for controlled/navigation-only mode where rendering is delegated to parent.

Extends

  • ICarouselBaseProps

Properties

Required

PropertyTypeDefaultDescription
children(currentIndex) => ReactNode-Render function that receives the current index and returns the slide content.
itemCountnumber-Total number of slides in the carousel.

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.