DS0
Components

Pagination

Navigation controls for moving between pages of content.

Overview

Pagination provides navigation controls for moving between discrete pages of content. It auto-computes which page numbers to show, including ellipsis for large ranges.

Usage


function Example() {
  const [page, setPage] = useState(1);
  return <Pagination totalPages={20} currentPage={page} onPageChange={setPage} />;
}

API Reference

PropTypeDefaultDescription
totalPagesnumberTotal number of pages
currentPagenumberCurrent active page
onPageChange(page: number) => voidPage change handler
siblingCountnumber1Sibling pages shown
showEdgesbooleantrueShow first/last page
size'sm' | 'md' | 'lg''md'Button size

Accessibility

  • <nav> with aria-label="Pagination"
  • Current page: aria-current="page"
  • Previous/Next: proper aria-label and aria-disabled
  • Button — Used for Previous/Next buttons

On this page