<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/monokai-sublime.min.css" integrity="sha512-ade8vHOXH67Cm9z/U2vBpckPD1Enhdxl3N05ChXyFx5xikfqggrK4RrEele+VWY/iaZyfk7Bhk6CyZvlh7+5JQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
🌾 ng-oatv0.6.0Angular UI library

Pagination

Page navigation with automatic ellipsis for large page counts.

InputTypeDefaultDescription
totalPagesnumberrequiredTotal number of pages
currentPagenumber1Current active page
maxVisiblenumber5Max visible page buttons
OutputTypeDescription
pageChangenumberEmitted with the new page number

Import & Usage

typescript
import { Component, signal } from '@angular/core';
import { NgOatPagination } from '@letsprogram/ng-oat/pagination';

@Component({
  selector: 'app-example',
  imports: [NgOatPagination],
  template: `
    <ng-oat-pagination
      [totalPages]="20"
      [currentPage]="page()"
      (pageChange)="page.set($event)" />
  `,
})
export class ExampleComponent {
  page = signal(1);
}

Interactive Pagination

Current page: 1

html
<ng-oat-pagination
  [totalPages]="10"
  [currentPage]="page()"
  (pageChange)="page.set($event)" />

Many Pages (with Ellipsis)

Page 25 of 50

html
<ng-oat-pagination
  [totalPages]="50"
  [currentPage]="currentPage()"
  (pageChange)="currentPage.set($event)" />

Few Pages

html
<ng-oat-pagination [totalPages]="3" [currentPage]="page()" (pageChange)="page.set($event)" />