UX4G Logo
Components

Pagination

Dot pagination indicators featuring animated pill active states, capsule containers, and flexible arrow alignments

The UX4G Pagination component provides animated dot progression indicators for multi-page carousels, onboarding walkthroughs, and large list views.

It supports:

  • Smooth Animation: Active page dot seamlessly expands into an elongated pill (size.dotSize * 2.5f).
  • Container Styling: Default borderless indicator or rounded Capsule container pill.
  • Arrow Alignments: Inline bilateral navigation chevrons (< ... dots ... >), chevron-free mode, or right-grouped arrow controls.
  • Sizes: Small (10dp dot, 24dp arrow) and Medium (12dp dot, 32dp arrow).

Import from com.ux4g.designsystemv1.components.pagination.*.


Interactive Previews

1. Default (Bilateral Arrows)

Standard pagination indicator with previous and next arrow buttons flanking the dot progression row.

Ux4gPaginationDotted (Default)Jetpack Compose
UX4G Default Pagination Preview

2. Capsule with Arrows

Pagination indicator wrapped inside a protective white capsule container pill with subtle borders and bilateral navigation arrows.

Ux4gPaginationDotted (Capsule with Arrows)Jetpack Compose
UX4G Capsule with Arrows Pagination Preview

3. Capsule without Arrows

Minimalist capsule pill enclosing only the animated page dots without arrow buttons.

Ux4gPaginationDotted (Capsule without Arrows)Jetpack Compose
UX4G Capsule without Arrows Pagination Preview

4. Capsule with Right-Aligned Arrows

Dot indicator row wrapped inside a capsule pill on the left, with previous and next arrow buttons grouped together on the right.

Ux4gPaginationDotted (Capsule with Right-Aligned Arrows)Jetpack Compose
UX4G Capsule with Right-Aligned Arrows Preview

5. Without Capsule with Right-Aligned Arrows

Borderless dot row aligned to the left, paired with right-grouped circular previous and next buttons.

Ux4gPaginationDotted (Without Capsule with Right-Aligned Arrows)Jetpack Compose
UX4G Without Capsule with Right-Aligned Arrows Preview

Kotlin Usage

Citizen Scheme Carousel Pagination Example
import androidx.compose.foundation.layout.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.ux4g.designsystemv1.components.pagination.*

@Composable
fun SchemeCarouselPaginationExample() {
    var activePage by remember { mutableStateOf(0) }
    val pageCount = 5

    Column(
        modifier = Modifier
            .fillMaxWidth()
            .padding(16.dp),
        horizontalAlignment = Alignment.CenterHorizontally,
        verticalArrangement = Arrangement.spacedBy(20.dp)
    ) {
        // Standard Dotted Indicator
        Ux4gPaginationDotted(
            totalPageCount = pageCount,
            currentPageIndex = activePage,
            onPageChange = { activePage = it },
            variant = Ux4gPaginationVariant.Default,
            size = Ux4gPaginationSize.Small
        )

        // Capsule Indicator with Right-Aligned Controls
        Ux4gPaginationDotted(
            totalPageCount = pageCount,
            currentPageIndex = activePage,
            onPageChange = { activePage = it },
            arrowsOnRight = true,
            variant = Ux4gPaginationVariant.Capsule,
            size = Ux4gPaginationSize.Medium
        )
    }
}

Parameters

Ux4gPaginationDotted Props

PropTypeDescriptionDefault
totalPageCount *IntTotal number of pages / steps in the progression sequence.—
currentPageIndex *IntZero-based index of the currently active page.—
onPageChange *(Int) -> UnitCallback invoked when a user clicks a dot or navigation arrow button.—
modifierModifierCompose layout modifier applied to outer container.Modifier
showArrowsBooleanControls whether previous and next arrow buttons are displayed.true
arrowsOnRightBooleanWhen true, groups navigation chevrons together on the right side.false
variantUx4gPaginationVariantVisual style of the indicator: Default or Capsule.Ux4gPaginationVariant.Default
sizeUx4gPaginationSizeSize preset: Small (10dp dot, 24dp arrow) or Medium (12dp dot, 32dp arrow).Ux4gPaginationSize.Small
enabledBooleanInteractive state for dot clicks and chevron triggers.true
activeColorColor?Background color of the active elongated pill dot.Ux4gColors.primary
inactiveColorColor?Background color of inactive dots and circular arrow buttons.Ux4gColors.primary100
inactiveBorderColorColor?Optional border color for inactive dots.Color.Transparent
widthDp?Optional explicit fixed width constraint.null
heightDp?Optional explicit fixed height constraint.null

Enums Reference

enum class Ux4gPaginationVariant {
    Default,  // Borderless clean indicator
    Capsule   // Rounded pill background container
}

enum class Ux4gPaginationSize(val dotSize: Dp, val spacing: Dp, val arrowSize: Dp) {
    Small(10.dp, 8.dp, 24.dp),    // Compact size
    Medium(12.dp, 10.dp, 32.dp)  // Standard touch target size
}

On this page