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
Capsulecontainer pill. - Arrow Alignments: Inline bilateral navigation chevrons (
<... dots ...>), chevron-free mode, or right-grouped arrow controls. - Sizes:
Small(10dp dot, 24dp arrow) andMedium(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.

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

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

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.

5. Without Capsule with Right-Aligned Arrows
Borderless dot row aligned to the left, paired with right-grouped circular previous and next buttons.

Kotlin Usage
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
| Prop | Type | Description | Default |
|---|---|---|---|
totalPageCount * | Int | Total number of pages / steps in the progression sequence. | — |
currentPageIndex * | Int | Zero-based index of the currently active page. | — |
onPageChange * | (Int) -> Unit | Callback invoked when a user clicks a dot or navigation arrow button. | — |
modifier | Modifier | Compose layout modifier applied to outer container. | Modifier |
showArrows | Boolean | Controls whether previous and next arrow buttons are displayed. | true |
arrowsOnRight | Boolean | When true, groups navigation chevrons together on the right side. | false |
variant | Ux4gPaginationVariant | Visual style of the indicator: Default or Capsule. | Ux4gPaginationVariant.Default |
size | Ux4gPaginationSize | Size preset: Small (10dp dot, 24dp arrow) or Medium (12dp dot, 32dp arrow). | Ux4gPaginationSize.Small |
enabled | Boolean | Interactive state for dot clicks and chevron triggers. | true |
activeColor | Color? | Background color of the active elongated pill dot. | Ux4gColors.primary |
inactiveColor | Color? | Background color of inactive dots and circular arrow buttons. | Ux4gColors.primary100 |
inactiveBorderColor | Color? | Optional border color for inactive dots. | Color.Transparent |
width | Dp? | Optional explicit fixed width constraint. | null |
height | Dp? | 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
}