Skip to content

Primer Design System

Main navigation navigation

Pagination

Use Pagination to display a sequence of links that allow navigation to discrete, related pages.
  • Experimental
  • Not reviewed for accessibility
import {Pagination} from '@primer/react-brand'

Examples

Default

Hide page numbers

Hide page numbers at specific breakpoints

Custom href

Custom data attributes

Component props

Pagination Required

nametypedefaultrequireddescription
pageCountnumbertrueThe total number of pages
currentPagenumbertrueThe current page number
onPageChange(e: React.MouseEvent, n: number) => voidfalseCallback function for when the page changes
hrefBuilder(n: number) => stringfalseFunction to build the href for each page
pageAttributesBuilder(n: number) => {[attributeName: string]: string}falseForward custom attributes to pagination links.
marginPageCountnumberfalseDefines how many pages are to be displayed on the left and right of the component
showPages'boolean'
'ResponsivePageVisibilityMap'
falseWhether to show the page numbers
surroundingPageCountnumberfalseThe number of pages to show on each side of the current page