Skip to main content

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 NameTypeDefault Value
showPageIndicatorsbooleanfalse

Example

Code

<Carousel showPageIndicators>
<img src="pexels-01.jpg" />
<img src="pexels-02.jpg" />
<img src="pexels-03.jpg" />
</Carousel>

Styling

pageIndicatorProps Details

Prop NameTypeDefault Value
pageIndicatorPropsobject (see below)see below
containerClassNamestringundefined
currentPageIndicatorClassNamestringundefined
pageIndicatorClassNamestringundefined

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>