Pagination API

API reference for the Pagination component: its props with their token values and defaults, the styled-system prop groups, and forwarded HTML attributes.

Demos

For usage examples, visit the component demo page: Pagination

Import

import { Pagination } from '@soroush.tech/design-system/Pagination'

Props

PropTypeDefaultDescription
countnumber-Total number of pages. Required.
pagenumber-Controlled current page (1-based).
defaultPagenumber1Uncontrolled initial page.
onChange(page: number) => void-Fired with the target page.
siblingCountnumber1Pages always visible either side of the current page.
boundaryCountnumber1Pages always visible at the start and end.
colorkeyof Theme['palette']'primary'Selected-item color.
variant'text' | 'outlined''text'Item style.
shape'circular' | 'rounded''circular'Item corner shape.
sizekeyof Theme['sizes']'md'Item density.
disabledbooleanfalseDisables every item.
shouldShowFirstButton / shouldShowLastButtonbooleanfalseAdds first/last-page buttons.
shouldHidePrevButton / shouldHideNextButtonbooleanfalseRemoves the previous/next buttons.
getItemAriaLabel(type, page, isSelected) => stringbuilt-inAccessible name per item ("Go to page 3", "Go to next page", ...).
aria-labelstring'pagination navigation'Landmark label.

usePagination

The headless model is exported for custom renderings:

import { usePagination } from '@soroush.tech/design-system/Pagination'

const { items } = usePagination({ count: 10, onChange })
// items: [{ type: 'previous', page, isSelected, isDisabled, onClick }, { type: 'page', ... }, ...]

Accessibility

  • Root landmark role="navigation" + aria-label.
  • Every actionable item has an accessible name via getItemAriaLabel; the current page carries aria-current="page".
  • Ellipses render as non-interactive, aria-hidden list items.

Source code

If this page does not answer your question, have a look at the implementation of the component for more detail.