Pagination organizes and divides large amounts of content on separate pages and gives the user control over how much content they want to view on each page.
Pagination can be used with a data table or on a page. It automatically truncates page numbers when there are many pages, using ellipses to indicate skipped pages.
When to use
When not to use
To use paginator in a standalone component, import DAFF_PAGINATOR_COMPONENTS directly into your custom component:
import { DAFF_PAGINATOR_COMPONENTS } from '@daffodil/design/paginator';
@Component({
selector: 'custom-component',
templateUrl: './custom-component.component.html',
imports: [
DAFF_PAGINATOR_COMPONENTS,
],
})
export class CustomComponent {}
To use paginator in a module, import DaffPaginatorModule into your custom module:
import { NgModule } from '@angular/core';
import { DaffPaginatorModule } from '@daffodil/design/paginator';
import { CustomComponent } from './custom.component';
@NgModule({
declarations: [
CustomComponent,
],
exports: [
CustomComponent,
],
imports: [
DaffPaginatorModule,
],
})
export class CustomComponentModule { }
Warning
This method is deprecated. It's recommended to update all custom components to standalone.
<daff-paginator aria-label="Search results page"></daff-paginator>
Ellipses are used to truncate page numbers when the total number of pages exceeds the maximum display limit. Double truncation appears when the current page is separated by more than three pages from both the first and last page.
role="navigation" on the paginator element to ensure proper semantic structure.
Use aria-label or aria-labelledby to give a meaningful label to <daff-paginator> that describes the content controlled by the paginator. If more than one paginator is used on a page, each will need a unique aria-label.
<daff-paginator aria-label="Product list paginator">
<!-- paginator content -->
</daff-paginator>
<daff-paginator aria-label="Search results paginator">
<!-- paginator content -->
</daff-paginator>