Page Indicators
Indicators that show what page the carousel is on. These pages are calculated from the scrollDistance
and have to be styled in addition to setting the showPageIndicators
boolean to true.
Details
Prop Name | Type | Default Value |
---|---|---|
showPageIndicators | boolean | false |
Example
Code
<Carousel showPageIndicators>
<img src="pexels-01.jpg" />
<img src="pexels-02.jpg" />
<img src="pexels-03.jpg" />
</Carousel>
Styling
pageIndicatorProps
Details
Prop Name | Type | Default Value |
---|---|---|
pageIndicatorProps | object (see below) | see below |
containerClassName | string | undefined |
currentPageIndicatorClassName | string | undefined |
pageIndicatorClassName | string | undefined |
Example
Code
<Carousel
showPageIndicators
pageIndicatorProps={{
containerClassName: 'flex items-center py-4 gap-1',
pageIndicatorClassName:
'w-3 h-3 p-0 rounded-full bg-gray-200 border-none cursor-pointer hover:bg-green-200',
currentPageIndicatorClassName: 'bg-green-500 hover:bg-green-500',
}}
>
<img src="pexels-01.jpg" />
<img src="pexels-02.jpg" />
<img src="pexels-03.jpg" />
</Carousel>