YuhuanStudioYunUIDocs
Navigation

Pagination

A controlled page navigator with prev/next arrows and ellipsis truncation.

A controlled page navigator. It renders previous/next arrows plus numbered page buttons with automatic ellipsis truncation — the first and last pages always stay visible, and siblingCount neighbours surround the current page. The host owns page state and routing: pass the current page and totalPages, and update on onPageChange. Renders nothing when totalPages <= 1.

Import

import { Pagination } from "@yuhuanowo/yunui";

Basic

Pagination is controlled, so wire page/onPageChange to your own state (or router):

Pagination

Props

PropTypeDefaultDescription
ariaLabelstringPaginationAccessible name for the wrapping nav landmark.
nextLabelstringGo to next pageAccessible label for the next-page button.
onPageChange*(page: number) => voidCalled with the requested page when a control is activated.
page*numberThe active page (1-based).
previousLabelstringGo to previous pageAccessible label for the previous-page button.
siblingCountnumber1How many page buttons to show on each side of the current page before collapsing into an ellipsis.
totalPages*numberTotal number of pages.

On this page