Pagination
A navigation bar that pages through long lists with jump and size controls.
Usage guidelines
- Use
Paginationfor a list that loads one page at a time, such as documents or run logs. UseTabsto switch between views andBreadcrumbto show a location in a hierarchy. - Control the page with
pageandonPageChange. Pages are one-based, out-of-range values clamp to the valid range, andonPageChangefires only when the page actually changes. - Derive
totalPagesfrom the item count and page size. When the page size changes, resetpageto the first page in the same handler. - The bar renders nothing when
totalPagesis zero, negative or non-finite. ShowPaginationSkeletonwhile the first page count is still loading. - Pass localized text:
aria-labelnames the navigation landmark (defaultPagination), andlabelssupplies the default names and labels for all built-in controls. Give each landmark a distinct name when a page has more than one. Paginationprovides shared page state and labels. Compose its parts to choose the layout; usePaginationContentfor the three-column bar (which wraps cleanly in narrow containers) or omit it for a compact layout.
Anatomy
PaginationPageList renders a PaginationPage for each number in the computed range and a PaginationEllipsis for each gap. Render PaginationPage directly for a custom page list; it reads the current page from Pagination.
Examples
Page range
siblingCount sets how many pages show on each side of the current page, and boundaryCount how many stay pinned at each end. Both default to 1. This bar composes Pagination with only the previous button, the page list and the next button.
Localized labels
labels localizes the previous, next and page-jump controls, page buttons (goToPage and currentPage), and the visible and accessible page-size label (perPage). Omitted entries fall back to English. Individual controls can override their accessible names; PaginationPageSize also accepts its own label and can be used independently of Pagination.
应用列表 · 第 41–60 项,共 386 项
Compact bar
Compose Pagination with only the navigation group for a narrow panel. The page-jump summary opens a number input when clicked.
Loading
PaginationSkeleton keeps the bar's height while the first page count loads and is hidden from assistive technology. Toggle between the skeleton and the loaded bar to compare their alignment.
Keyboard
| Key | Action |
|---|---|
| EnterorSpace | Activates the focused previous, next or page button. On the page summary, opens the page number input. |
| Up arroworDown arrow | In the page number input, adjusts the draft page without leaving edit mode. |
| HomeorEnd | In the page number input, sets the draft page to the first or last page without leaving edit mode. |
| Enter | In the page number input, goes to the edited page and returns focus to the summary. |
| Tab | In the page number input, goes to the edited page and moves focus to the next control. |
| Escape | In the page number input, discards the edited page and returns focus to the summary. |
| Left arroworRight arrow | On the page-size selector, selects the previous or next size, wrapping at the ends. |
API reference
Pagination
Provides pagination state, page-range computation, and default control labels for composed pagination layouts. Renders a <nav> element, or null when totalPages <= 0.
| Prop | Type | Default | Details |
|---|---|---|---|
page required | number | No default | |
totalPages required | number | No default | |
onPageChange required | (page: number) => void | No default | |
siblingCount | number | 1 | |
boundaryCount | number | 1 | |
labels | Partial<PaginationLabels> | No default | |
render | ComponentRenderFn<HTMLProps, {}> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | No default | |
PaginationContent
| Prop | Type | Default | Details |
|---|---|---|---|
render | ComponentRenderFn<HTMLProps, {}> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | No default | |
PaginationEllipsis
| Prop | Type | Default | Details |
|---|---|---|---|
render | ComponentRenderFn<HTMLProps, {}> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | No default | |
PaginationNavigation
| Prop | Type | Default | Details |
|---|---|---|---|
render | ComponentRenderFn<HTMLProps, {}> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | No default | |
PaginationNext
A button component that can be used to trigger actions. Renders a <button> element.
| Prop | Type | Default | Details |
|---|---|---|---|
children | React.ReactNode | No default | |
className | string | ((state: ButtonState) => string | undefined) | No default | |
render | ComponentRenderFn<HTMLProps, ButtonState> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | No default | |
style | React.CSSProperties | ((state: ButtonState) => React.CSSProperties | undefined) | No default | |
nativeButton | boolean | true | |
focusableWhenDisabled | boolean | false | |
| Attribute | Description |
|---|---|
data-disabled | Present when the button is disabled. |
PaginationPage
A button component that can be used to trigger actions. Renders a <button> element.
| Prop | Type | Default | Details |
|---|---|---|---|
page required | number | No default | |
children | React.ReactNode | No default | |
className | string | ((state: ButtonState) => string | undefined) | No default | |
render | ComponentRenderFn<HTMLProps, ButtonState> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | No default | |
style | React.CSSProperties | ((state: ButtonState) => React.CSSProperties | undefined) | No default | |
nativeButton | boolean | true | |
focusableWhenDisabled | boolean | false | |
| Attribute | Description |
|---|---|
data-disabled | Present when the button is disabled. |
PaginationPageJump
A button component that can be used to trigger actions. Renders a <button> element.
| Prop | Type | Default | Details |
|---|---|---|---|
inputLabel | string | No default | |
children | React.ReactNode | No default | |
className | string | ((state: ButtonState) => string | undefined) | No default | |
render | ComponentRenderFn<HTMLProps, ButtonState> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | No default | |
style | React.CSSProperties | ((state: ButtonState) => React.CSSProperties | undefined) | No default | |
nativeButton | boolean | true | |
focusableWhenDisabled | boolean | false | |
| Attribute | Description |
|---|---|
data-disabled | Present when the button is disabled. |
PaginationPageList
| Prop | Type | Default | Details |
|---|---|---|---|
render | ComponentRenderFn<HTMLProps, {}> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | No default | |
PaginationPageSize
| Prop | Type | Default | Details |
|---|---|---|---|
value required | Value | No default | |
options required | readonly Value[] | No default | |
onValueChange required | (value: Value) => void | No default | |
label | React.ReactNode | No default | |
aria-label | string | No default | |
className | string | No default | |
PaginationPrevious
A button component that can be used to trigger actions. Renders a <button> element.
| Prop | Type | Default | Details |
|---|---|---|---|
children | React.ReactNode | No default | |
className | string | ((state: ButtonState) => string | undefined) | No default | |
render | ComponentRenderFn<HTMLProps, ButtonState> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | No default | |
style | React.CSSProperties | ((state: ButtonState) => React.CSSProperties | undefined) | No default | |
nativeButton | boolean | true | |
focusableWhenDisabled | boolean | false | |
| Attribute | Description |
|---|---|
data-disabled | Present when the button is disabled. |
PaginationSkeleton
| Prop | Type | Default | Details |
|---|---|---|---|
render | ComponentRenderFn<HTMLProps, {}> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | No default | |