Skip to content

Pagination

A navigation bar that pages through long lists with jump and size controls.

hero.tsx

Usage guidelines

  • Use Pagination for a list that loads one page at a time, such as documents or run logs. Use Tabs to switch between views and Breadcrumb to show a location in a hierarchy.
  • Control the page with page and onPageChange. Pages are one-based, out-of-range values clamp to the valid range, and onPageChange fires only when the page actually changes.
  • Derive totalPages from the item count and page size. When the page size changes, reset page to the first page in the same handler.
  • The bar renders nothing when totalPages is zero, negative or non-finite. Show PaginationSkeleton while the first page count is still loading.
  • Pass localized text: aria-label names the navigation landmark (default Pagination), and labels supplies the default names and labels for all built-in controls. Give each landmark a distinct name when a page has more than one.
  • Pagination provides shared page state and labels. Compose its parts to choose the layout; use PaginationContent for the three-column bar (which wraps cleanly in narrow containers) or omit it for a compact layout.

Anatomy

tsx
tsx

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.

page-range.tsx

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 项

localized-labels.tsx

Compact bar

Compose Pagination with only the navigation group for a narrow panel. The page-jump summary opens a number input when clicked.

compact.tsx

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.

loading.tsx

Keyboard

KeyAction
EnterorSpaceActivates the focused previous, next or page button. On the page summary, opens the page number input.
Up arroworDown arrowIn the page number input, adjusts the draft page without leaving edit mode.
HomeorEndIn the page number input, sets the draft page to the first or last page without leaving edit mode.
EnterIn the page number input, goes to the edited page and returns focus to the summary.
TabIn the page number input, goes to the edited page and moves focus to the next control.
EscapeIn the page number input, discards the edited page and returns focus to the summary.
Left arroworRight arrowOn 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.

Base UI Pagination docs

Props
PropTypeDefaultDetails
page requirednumberNo default
totalPages requirednumberNo default
onPageChange required(page: number) => voidNo default
siblingCountnumber1
boundaryCountnumber1
labelsPartial<PaginationLabels>No default
Base UI Pagination docs

PaginationContent

PaginationEllipsis

PaginationNavigation

PaginationNext

A button component that can be used to trigger actions. Renders a <button> element.

Base UI Button docs

Props
PropTypeDefaultDetails
childrenReact.ReactNodeNo default
Base UI Button docs
Data attributes
AttributeDescription
data-disabled

Present when the button is disabled.

PaginationPage

A button component that can be used to trigger actions. Renders a <button> element.

Base UI Button docs

Props
PropTypeDefaultDetails
page requirednumberNo default
childrenReact.ReactNodeNo default
Base UI Button docs
Data attributes
AttributeDescription
data-disabled

Present when the button is disabled.

PaginationPageJump

A button component that can be used to trigger actions. Renders a <button> element.

Base UI Button docs

Props
PropTypeDefaultDetails
inputLabelstringNo default
childrenReact.ReactNodeNo default
Base UI Button docs
Data attributes
AttributeDescription
data-disabled

Present when the button is disabled.

PaginationPageList

PaginationPageSize

Props
PropTypeDefaultDetails
value requiredValueNo default
options requiredreadonly Value[]No default
onValueChange required(value: Value) => voidNo default
labelReact.ReactNodeNo default
aria-labelstringNo default
classNamestringNo default

PaginationPrevious

A button component that can be used to trigger actions. Renders a <button> element.

Base UI Button docs

Props
PropTypeDefaultDetails
childrenReact.ReactNodeNo default
Base UI Button docs
Data attributes
AttributeDescription
data-disabled

Present when the button is disabled.

PaginationSkeleton