Skip to main content
Version: 1.0.4

ICarouselProps

@spartanfx/react v1.0.4


@spartanfx/react / ICarouselProps

Type Alias: ICarouselProps<T>

ICarouselProps<T> = ICarouselItemsProps<T> | ICarouselControlledProps

Props for the Carousel component, supporting both items-driven and controlled modes.

Type Parameters

T

T = unknown

The type of data in carousel items (for items-driven mode)

Example

// Items-driven mode
const itemsProps: ICarouselProps<MyData> = {
items: [...],
renderItem: (item) => <div>{item.data.title}</div>
};

// Controlled mode
const controlledProps: ICarouselProps = {
itemCount: 5,
children: (index) => <div>Slide {index}</div>
};