Pagination

Move between pages of results.

Source

Basic

Use md by default and sm in dense UI, such as under a compact table. The previous and next controls stop at the ends.

Many pages with ellipses

Show the first and last pages, the current page, and its neighbors.

Compact

Use compact in narrow containers. It shows the page count between the previous and next controls. It does not switch on its own.

Usage

These are defaults, not laws. Break one when you have a good reason, or when it makes the design more cohesive or more interesting.

  • Pages start at 1.

API

Pagination is a site component. It uses the library Button, IconButton, and ButtonLink components.

Pagination

PropTypeDefaultDescription
pagenumber–The current page, starting at 1. Required.
pageCountnumber–The total number of pages. Required.
onPageChange(page: number) => void–Receives a page number when a button activates.
getPageHref(page: number) => string–Returns a URL for each page. Enables link mode.
siblingCountnumber1The number of visible pages on each side of the current page.
size'sm' | 'md' | 'lg''md'Sets the size of every button.
compactbooleanfalseShows the page count instead of page buttons.
classNamestring–Adds classes to the navigation element.