Skip to content

Pagination

Page number controls for navigating through paginated content. Includes previous/next buttons and numbered pages.

Preview

Middle page active

States

StateAppearance
DefaultBordered button with page number
HoverSubtle background fill, stronger border
Active/CurrentBrand colour fill, white text
Disabled40% opacity (prev on page 1, next on last)
Focus2 px brand-purple ring

Props

PropTypeDefaultDescription
pagenumber--Current page (1-indexed)
totalPagesnumber--Total number of pages
onChange(page: number) => void--Page change handler
siblingCountnumber1Pages shown around current page
boundaryCountnumber1Pages shown at start/end

Code example

React

tsx
import { Pagination } from '@thepace/lexicon/components';

<Pagination page={5} totalPages={10} onChange={setPage} />

Vanilla HTML

html
<nav class="lex-pagination" aria-label="Pagination">
  <button class="lex-pagination__btn" aria-label="Previous page">‹</button>
  <button class="lex-pagination__btn lex-pagination__btn--active"
          aria-current="page">1</button>
  <button class="lex-pagination__btn">2</button>
  <span class="lex-pagination__ellipsis">…</span>
  <button class="lex-pagination__btn">10</button>
  <button class="lex-pagination__btn" aria-label="Next page">›</button>
</nav>

CSS class reference

ClassPurpose
.lex-paginationContainer
.lex-pagination__btnPage button
.lex-pagination__btn--activeCurrent page (filled)
.lex-pagination__ellipsisTruncation indicator

Accessibility

  • Wrap in <nav aria-label="Pagination">.
  • Current page has aria-current="page".
  • Prev/Next buttons have aria-label.
  • Disabled buttons on first/last page boundaries.

Guidelines

Do

  • Show ellipsis for large page counts with siblingCount and boundaryCount.
  • Disable Prev on page 1 and Next on the last page.

Don't

  • Don't render all page numbers for large datasets — use ellipsis truncation.
  • Don't use pagination for infinite scrolling content.

Released under the MIT License. A product by the pace.