Pagination

Navigation

Configurable page navigation controls with ellipsis truncation, page size selection, and total count display

Pagination

A flexible pagination component with variants, sizes, shapes, custom labels and support for large page ranges and real-world data tables.

Basic usage

At minimum, provide the total number of pages and the current page. Use controlled state with currentPage and onPageChange for interactive UIs.

Static example

Controlled (onPageChange)

Current page: 1

Variants

Use the variant prop to change the appearance of the pagination component. Common options include default, primary, secondary, outlined and minimal.

Default

Primary

Secondary

Outlined

Minimal

Sizes

Adjust density using the size prop. Use sm for compact, md for defaults and lg for prominent pagination controls.

Small

Medium (default)

Large

Shapes

Use the shape prop to control rounding:rounded, square or pill.

Rounded

Square

Pill

Interactive pagination

Use controlled state to respond to page changes and update surrounding UI such as labels or data tables.

Interactive example

You are on page 1 of 10.

Large page ranges & ellipsis

For large sets, configure siblingCount to show nearby pages with ellipsis when ranges are truncated.

50 pages — current: 5

100 pages — current: 25

Custom labels & controls

Override text for first, last, previous and next labels or hide specific controls for simplified pagination UIs.

Text labels

Without first/last

Only page numbers

Disabled

Use the disabled prop to render non-interactive pagination, useful while loading or when no data is available.

Real-world example: data table

Combine pagination with a data table to paginate over records. Here, 10 rows are shown per page out of 100 mock users.

User list

Showing 1 - 10 of 100 users

IDNameEmailRole
1User 1[email protected]Viewer
2User 2[email protected]Editor
3User 3[email protected]Admin
4User 4[email protected]Editor
5User 5[email protected]Viewer
6User 6[email protected]Admin
7User 7[email protected]Viewer
8User 8[email protected]Editor
9User 9[email protected]Admin
10User 10[email protected]Editor

Usage Guidelines

When to Use

  • Long lists
  • Search results
  • Data tables

Accessibility

  • Current page announced
  • Disabled state for first/last
  • aria-label on controls

Performance

  • Only visible pages rendered
  • Memoized calculations

Common Mistakes

  • Not showing total count
  • Page numbers too small to tap on mobile

Frequently Asked Questions

Yes, you can add a page size selector alongside pagination controls.
Pagination automatically shows ellipsis when there are many pages, displaying first, last, and nearby pages.

View on GitHub

See the full source code on GitHub