Paginator

Page navigation for long lists, with a page size select, a page report and a total.

Features12APIThemingAccessibility

Basic

Bind [(first)], rows and totalRecords; pageChange reports the new page. The current page has aria-current="page".

Page 1 of 12, records from 1

Rows per page

rowsPerPageOptions adds a page size select; [(rows)] follows it. A size that is not in the list (here 20) is added, { showAll: 'All' } shows every record. After a size change the first record of the page stays on screen.

20 rows per page, first record 1

Total

showTotal writes the translated "Total: N" at the start. On narrow screens it moves above the page buttons.

Total: 1284

Current page report

showCurrentPageReport shows "3 of 12" (translated). currentPageReportTemplate takes {currentPage}, {totalPages}, {first}, {last}, {rows} and {totalRecords}; the report is a polite live region.

Jump to page

showJumpToPageDropdown adds a select with every page; showJumpToPageInput adds a field — Enter or leaving it goes to the typed page (out of range numbers are clamped).

Compact

Below compactBreakpoint (40rem by default) the paginator shows compactPageLinkSize page buttons (3) and no first / last buttons, so it fits one line on a phone. Narrow the window to see it; the second paginator is compact below 100rem.

Server

Server pages: pageChange gives first and rows for the request, TxPaginationParams is the shape of the request (page is 1-based) and firstToPage converts. The list below is loaded with a delay.

  • Invoice #0001
  • Invoice #0002
  • Invoice #0003
  • Invoice #0004
  • Invoice #0005
Total: 87

Template

txPaginatorStart and txPaginatorEnd put own content at the ends of the bar; both get the page state.

Icons

Own icons for the navigation buttons: firstPageIcon, previousPageIcon, nextPageIcon, lastPageIcon. In right-to-left pages the arrows turn around.

States

disabled turns every control off. With [alwaysShow]="false" a list of one page has no paginator at all.

Pass through

pt adds classes and styles to the parts — here a bordered bar and bold page numbers.

Design tokens

dt changes the tokens of one paginator — round page buttons with a dark current page.