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.
<daff-paginator
aria-label="Search results page"
[numberOfPages]="numberOfPages"
[currentPage]="currentPage"
(notifyPageChange)="onPageChange($event)"
></daff-paginator>
When to use
When not to use
Import DAFF_PAGINATOR_COMPONENTS into your 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 {}
Deprecation notice:
DaffPaginatorModuleis deprecated. Use the standalone component imports instead.
A paginator is a single navigation element labeled for the content it controls:
<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 structurearia-label or aria-labelledby to give <daff-paginator> a meaningful label that describes the content it controlsaria-label<daff-paginator aria-label="Product list paginator">
<!-- paginator content -->
</daff-paginator>
<daff-paginator aria-label="Search results paginator">
<!-- paginator content -->
</daff-paginator>