Skip to content
Okaapiأوكابي
Framework for the code
Theme
Okaapi on GitHub

Chapter 07 Navigation

Pagination

Moves through long lists a page at a time. A named navigation landmark: each page button says its number, the current page is marked, and the line of shown rows is announced when it changes.

Use it in Angular
import { PaginationComponent } from '@okaapi-ui/angular';

Pages

The first and last page, the current one and its neighbours. Previous and next stay focusable at the ends, so focus never jumps away. On a phone only the arrows and the current page show.

Angular
page = signal(5);

<ui-pagination [(page)]="page" [total]="230" [pageSize]="10" />

Rows per page

Changing the size goes back to page 1, so the reader never lands on a page that no longer exists. Two paginations on one page need different names, so this one is called Order pages.

Angular
<ui-pagination
  [(page)]="page"
  [(pageSize)]="pageSize"
  [total]="42"
  [pageSizes]="[10, 20, 50]"
  [labels]="{ nav: 'Order pages' }"
/>

In Arabic

Angular
labels = {
  nav: 'التنقل بين الصفحات',
  previous: 'الصفحة السابقة',
  next: 'الصفحة التالية',
  page: (n: number) => `صفحة ${n}`,
  summary: (first: number, last: number, total: number) => `${first}–${last} من ${total}`,
  pageSize: 'عدد الصفوف',
};

<ui-pagination [(page)]="page" [total]="230" [pageSize]="10" [labels]="labels" />

When to use something else

If you needUse
Steps of a taskStepper
Where the page sits in the siteBreadcrumbs

Inputs

NameTypeDefaultWhat it does
pagenumber (model) — Required. The current page, from 1. Bind [(page)].
totalnumber — Required. Rows across all pages.
pageSizenumber (model)10Rows per page. Bind [(pageSize)] with a picker.
pageSizesnumber[][]Offer these sizes in a picker. Empty: no picker.
labelsPartial<PaginationLabels> — Translated texts: nav, previous, next, page(n), summary(first, last, total), pageSize.

Keyboard and screen readers

KeysWhat they do
Tab Move between the page buttons.
  • A named navigation landmark; each button says its page number, and the current page is marked.
  • The line of shown rows is announced when it changes.