Umbra UI

Pagination

Moves between pages of results.

Staticimport { Pagination } from 'umbra-ui'

Props

PropTypeDefaultDescription
count requirednumber—Total number of pages.
aria-label stringPaginationAccessible name of the navigation landmark.
defaultPage number1Starting page when uncontrolled.
onPageChange ((page: number) => void)—Called with the new page.
page number—Current page (1-based), when controlled.
siblings number1Pages shown either side of the current one.
size "sm" | "md" | "lg"mdButton size.

Usage notes

Pages are numbered from 1. Use page with onPageChange to control it, or defaultPage to let it manage itself. The first and last pages are always shown, with siblings pages either side of the current one.

The same page list is exported as pageRange(page, count, siblings) if you build your own layout.

Accessibility

  • A nav landmark named "Pagination" (change it with aria-label).
  • The current page has aria-current="page"; Previous and Next are disabled at the ends.

Import

import { Pagination } from 'umbra-ui';
import 'umbra-ui/styles.css'; // once, at the root of your app