Pagination
Moves between pages of results.
Staticimport { Pagination } from 'umbra-ui'
Props
| Prop | Type | Default | Description |
|---|---|---|---|
count required | number | — | Total number of pages. |
aria-label | string | Pagination | Accessible name of the navigation landmark. |
defaultPage | number | 1 | Starting page when uncontrolled. |
onPageChange | ((page: number) => void) | — | Called with the new page. |
page | number | — | Current page (1-based), when controlled. |
siblings | number | 1 | Pages shown either side of the current one. |
size | "sm" | "md" | "lg" | md | Button 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
navlandmark named "Pagination" (change it witharia-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