Pager

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

Usage

Default


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

Props

Data table
TypeDescription
aria-describedbystringOptional description id for the pagination navigation region.
aria-labelstringAccessible label for the pagination navigation region.
aria-labelledbystringOptional labelledby id for the pagination navigation region.
classNamestringOptional extra class name(s) for custom styling.
currentPagenumberThe currently active page (1-indexed).
data-testidstringOptional test ID for testing frameworks.
getLiveRegionMessage((currentPage: number, totalPages: number) => string)Function used to generate the live region status message.
getPageAriaLabel((page: number, isActive: boolean) => string)Function used to generate an accessible label for each page button.
itemsPerPagenumberNumber of items to display per page.
liveRegionAriaLive"off" | "polite" | "assertive"ARIA live politeness setting for the status message.
next-button-aria-labelstringAccessible label for the next page button.
onPageChange(page: number) => voidCallback function invoked when a page change occurs.
page-list-aria-labelstringAccessible label for the page list.
previous-button-aria-labelstringAccessible label for the previous page button.
roundingRoundingTypeRounding of the controls. One of: "none" | "small" | "medium" | "large" | "full"
serverControlledbooleanEnables server side control of the paging.
shadowShadowTypeShadow of the controls. One of: "none" | "light" | "medium" | "strong" | "intense"
sizeSizeTypeOptional size modifier for pagination buttons. One of: "xs" | "small" | "medium" | "large" | "xl"
stateStateTypeOptional state of the component for feedback styling. One of: "success" | "error" | "warning" | "disabled" | ""
themeThemeTypeOptional theme to apply for pagination. One of: "primary" | "secondary" | "tertiary" | "quaternary" | "clear"
totalItemsnumberTotal number of items to paginate through.