Skip to content

Pagination component

Pagination is a windowed page-number control for a list or table footer, with previous/next buttons and an optional "Showing X–Y of Z" summary (PaginationSummary).

Navigation16 propsAccessibility notes

Playground

Change a prop on the right and the preview updates. Switch to Code to copy what you see.

Recipes

Copy-paste patterns for the ways Pagination actually gets used — each one a real, self-contained example.

Page control

A windowed page-number control — pass the current page, the total pageCount, and an onChange to move between pages.

const [page, setPage] = useState(1);

<Pagination aria-label="Basic pagination" page={page} pageCount={12} onChange={setPage} />

With a results summary

PaginationSummary prints a “Showing X–Y of Z” line — pair it with Pagination in a list or table footer.

<div className="flex items-center justify-between">
  <PaginationSummary page={page} pageSize={20} total={438} />
  <Pagination aria-label="Pagination with summary" page={page} pageCount={22} onChange={setPage} />
</div>

Example

pagination.tsx
<div className="flex items-center justify-between">
  <PaginationSummary page={page} pageSize={20} total={438} />
  <Pagination page={page} pageCount={22} onChange={setPage} />
</div>

Props

The full public API for Pagination. Every prop is stable and intentionally typed.

Data

pageCount

number

default: —

Total pages. Or pass total + pageSize.

total / pageSize

number

default: — / 10

Item count → derives pageCount.

page / defaultPage

number

default: — / 1

Controlled / initial page (1-based).

Behavior & states

onChange

(page: number) => void

default: —

Fired on any page change.

isDisabled

boolean

default: false

Disable every button.

getItemAriaLabel

(type, page, isSelected) => string

default: —

Localise the button labels.

Appearance

siblingCount

number

default: 1

Pages shown either side of the current one.

boundaryCount

number

default: 1

Pages always shown at each end.

showEdges

boolean

default: false

First / last jump buttons.

hideNavigation

boolean

default: false

Hide the prev / next arrows.

size

"sm" | "md" | "lg"

default: md

Control size.

variant

"solid" | "soft" | "bordered" | "ghost"

default: solid

Styles the selected page. Same vocabulary as Button/Chip.

color

"default" | "primary" | "secondary" | "info" | "success" | "warning" | "danger"

default: primary

Selected-page color.

radius

"none" | "xs" | "xs-sm" | "sm" | "md" | "lg" | "full"

default: md

Corner rounding of each page button.

Styling

classNames

{ base?, list?, item?, page?, prev?, next?, ellipsis? }

default: —

Slot classes.

Content

PaginationSummary

{ page, pageSize, total, format? }

default: —

Renders "Showing X–Y of Z"; format(from, to, total) overrides the text.

Accessibility

  • Wrapped in `<nav aria-label="Pagination">`; the current page button has `aria-current="page"`.
  • Previous/next buttons are disabled (not hidden) at the ends and keep an accessible name.
  • The ellipsis is inert text, not a focusable control.