Pager

The Pager component allows for pagination controls to navigate large datasets by limiting the number of items displayed at once.

Usage & Examples

Default

default.tsx

<Pager
  totalItems={20}
  itemsPerPage={2}
  currentPage={1}
  onPageChange={(pageNumber) => console.log("Page changed:", pageNumber)}
/>

Props API

23 props
Columns
Pager props API
Default
Description
aria-describedbystringNoariaOptional description id for the pagination navigation region.
aria-labelstringNoaria"Pagination"Accessible label for the pagination navigation region.
aria-labelledbystringNoariaOptional labelledby id for the pagination navigation region.
classNamestringNostylingOptional extra class name(s) for custom styling.
currentPagenumberYespropsThe currently active page (1-indexed).
data-testidstringNotestingBackward-compatible alias for test ID attributes.
getLiveRegionMessage((currentPage: number, totalPages: number) => string)Noevents(activePage, totalPages) => `Page ${activePage} of ${totalPages}`Function used to generate the live region status message.
getPageAriaLabel((page: number, isActive: boolean) => string)Noevents(pageNumber, isActive) => isActive ? `Current page, page ${pageNumber}` : `Go to page ${pageNumber}`Function used to generate an accessible label for each page button.
glassbooleanNopropsconfigured default glass setting (fallback: false)Applies a translucent frosted-glass treatment to the pager and nested controls.
itemsPerPagenumberYespropsNumber of items to display per page.
liveRegionAriaLive"off" | "polite" | "assertive"Noprops"polite"ARIA live politeness setting for the status message.
next-button-aria-labelstringNoprops"Go to next page"Accessible label for the next page button.