Skip to content
Alea0.1

Navigation

Pagination

Move through pages of results, with the long middle collapsed.

Ant Design: Pagination

import { Pagination } from '@alea/ui';

Examples

Pagination

The long middle collapses around the current page.

Page 6 of 24

Compact

For phones and tight toolbars.

Props

Pagination props

Move through pages of results. The current page is marked for screen readers.

PropTypeDefaultDescription
onChangerequired(page: number) => void-Called with the new page number.
pagerequirednumber-Current page, from 1.
totalrequirednumber-Total pages.
appearance"pages" | "compact"'pages'compact shows "3 of 12" between the arrows instead of page numbers.
aria-labelstring-Name for screen readers. Default "Pagination".
classNamestring-Extra class names for the root element.
siblingsnumber1Pages shown on each side of the current one. Default 1.

Accessibility

  • A navigation landmark; each page button is named "Page n" and the current one has aria-current.

Keyboard

KeyDoes
TabMoves between page buttons
Enter or SpaceGoes to that page

Do and don't

Do

  • Keep the total visible.
  • Use compact on narrow screens.

Don't

  • Don't paginate short lists: show them all or load more.
Tested with axe, keyboard and screen reader roles