HorizontalPageIndicator

Composable Component

Horizontal page indicator for use with HorizontalPager, representing the currently active page and the approximate number of pages. Pages are indicated as a Circle shape. The indicator shows up to six pages individually - if there are more than six pages, HorizontalPageIndicator shows a smaller indicator to the left and/or right to indicate that more pages are available.

Android
@Composable
public fun HorizontalPageIndicator(
    pagerState: PagerState,
    modifier: Modifier = Modifier,
    selectedColor: Color = PageIndicatorDefaults.selectedColor,
    unselectedColor: Color = PageIndicatorDefaults.unselectedColor,
    backgroundColor: Color = PageIndicatorDefaults.backgroundColor,
)

Parameters

pagerStateState of the HorizontalPager used to control this indicator
modifierModifier to be applied to the HorizontalPageIndicator
selectedColorThe color which will be used for a selected indicator item.
unselectedColorThe color which will be used for an unselected indicator item.
backgroundColorThe color which will be used for an indicator background.