StylishPagination

fun StylishPagination(page: Int, onPageChange: (Int) -> Unit, modifier: Modifier = Modifier, pageCount: Int, siblingCount: Int = 1, boundaryCount: Int = 1, enabled: Boolean = true, shape: Shape = RoundedCornerShape(DefaultStylishDimensions.connectedCornerRadius), colors: ButtonColors = ButtonDefaults.buttonColors( containerColor = MaterialTheme.colorScheme.primary, contentColor = MaterialTheme.colorScheme.onPrimary, ), unselectedColors: ButtonColors = ButtonDefaults.buttonColors( containerColor = MaterialTheme.stylishComponentColors.groupedContainer, contentColor = MaterialTheme.colorScheme.onSurface, ))

A pager control for long lists — the web "Pagination" pattern from shadcn/ui, MUI, and Ant Design.

The page-number window keeps the first/last boundaryCount pages always visible and shows a window of up to siblingCount * 2 + 1 pages around the current page, collapsing the rest with ellipses.

Parameters

page

The current page (1-based).

onPageChange

Called with the new page when the user navigates.

modifier

Modifier applied to the root row.

pageCount

Total number of pages. Must be at least 1.

siblingCount

Number of page buttons shown on each side of the current page before ellipsis collapse. Defaults to 1.

boundaryCount

Number of always-visible pages at the start and end. Defaults to 1.

enabled

When false, all controls are disabled.

shape

Corner shape of the page buttons. Defaults to RoundedCornerShape with DefaultStylishDimensions.connectedCornerRadius.

colors

ButtonColors for the current page button. Defaults to the primary container.

unselectedColors

ButtonColors for other page buttons. Defaults to the grouped-container look.