ICarouselProps
@spartanfx/react / index / ICarouselProps
Type Alias: ICarouselProps<T>
type 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>
};