Carousel
A horizontally paged scroll view with a dot-page indicator.
#0d9488
#e5193a
#2563eb
<Carousel
data={slides}
renderItem={(slide) => <SlideCard slide={slide} />}
/>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
data | TItem[] | Required. Items to page through. | |
renderItem | (item: TItem, index: number) => ReactNode | Required. Renders each page. | |
keyExtractor | (item: TItem, index: number) => string | Keys each page; defaults to its index. | |
itemWidth | number | Width of each page. Defaults to the carousel's own measured width (full-bleed paging). | |
showIndicator | boolean | true | Shows the dot-page indicator below the carousel. |
activeDotColor | TVajraColors | 'primary' | Color of the active page's dot. |
inactiveDotColor | TVajraColors | 'border' | Color of inactive dots. |
onIndexChange | (index: number) => void | Called when the active page changes. |