Compose Component

HorizontalPageIndicator

Horizontal page indicator for use with HorizontalPager, representing the currently active page and the approximate number of pages.

HorizontalPageIndicator social preview

HorizontalPageIndicator

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

Parameters

pagerState State of the HorizontalPager used to control this indicator
modifier Modifier to be applied to the HorizontalPageIndicator
selectedColor The color which will be used for a selected indicator item.
unselectedColor The color which will be used for an unselected indicator item.
backgroundColor The color which will be used for an indicator background.
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: