PolyHunter

Pagination

Page navigation with compact 36px items. Unselected pages are bare text; the active page sits on a raised selection pill. More than five More than seven pages shows a sliding window around the current page, anchored by the first and last pages with ellipses for the gaps.

Playground

Live preview

Examples

Few pages (all visible)

Many pages (smart window)

Page 10 of 24 — the window slides so the selection never disappears

<Pagination page={page} totalPages={24} onPageChange={setPage} />
// page 1:   ‹ 1 2 3 … 24 ›
// page 10:  ‹ 1 … 9 10 11 … 24 ›
// page 24:  ‹ 1 … 22 23 24 ›

Cursor pagination

Cursor batch 1 of 3

<CursorPagination
  hasPrevious={hasPrevCursor}
  hasNext={hasNextCursor}
  onPrevious={() => fetchPrev(afterCursor)}
  onNext={() => fetchNext(beforeCursor)}
/>
// No page numbers — for cursor-based APIs

Disabled

Code

import { Pagination } from "@npolyhunter/ui";

<Pagination
  page={page}               // 1-based
  totalPages={totalPages}
  onPageChange={setPage}
  disabled={loading}        // 45% opacity, arrows blocked at edges
/>

// up to 7 pages: all pages shown
// beyond 7: sliding window around the current page + first/last, e.g.
//   page 1:   ‹ 1 2 3 … 24 ›
//   page 10:  ‹ 1 … 9 10 11 … 24 ›
//   page 24:  ‹ 1 … 22 23 24 ›

Code

import { Pagination } from "@npolyhunter/ui";

<Pagination
  page={page}               // 1-based
  totalPages={totalPages}
  onPageChange={setPage}
  disabled={loading}        // 45% opacity, arrows blocked at edges
/>

// up to 7 pages: all pages shown
// beyond 7: sliding window around the current page + first/last, e.g.
//   page 1:   ‹ 1 2 3 … 24 ›
//   page 10:  ‹ 1 … 9 10 11 … 24 ›
//   page 24:  ‹ 1 … 22 23 24 ›

Used in

Includes use through shared UI components.

AppBack Office