Pagination
Navigationatlas-paginationExamples
Basic
Bind [(currentPage)] ; ellipses collapse long ranges around siblingCount pages.
Page 5 of 20
Siblings and first/last buttons
siblingCount sets how many pages show around the current one before an ellipsis. [showFirstLastButtons]="false" drops the first/last buttons where space is tight.
Page 12 of 40
Paging a list
Bind currentPage and slice your data. The pager is a navigation landmark; moving to a page keeps focus on the pager.
- Order #1001
- Order #1002
- Order #1003
- Order #1004
- Order #1005
Compact
[compact]="true" fits a phone: previous, "Page X of Y", next. Put an atlas-select with the atlasPaginationJump attribute in it to jump to any page; pageWindow() lists the options.
API
Generated from the library source, so it always matches the code.
AtlasPaginationComponent atlas-pagination
| Input | Type | Default | Description |
|---|---|---|---|
| totalPages required | number | — | |
| currentPage two-way | number | 1 | |
| siblingCount | number | 1 | |
| showFirstLastButtons | boolean | true | |
| compact | boolean | false | atlasPaginationJump attribute, such as an atlas-select , to replace the text with a jump control. |
| class | string | '' | cn() ; yours win on conflicts. |
Functions
| Function | Description |
|---|---|
| pageWindow(current: number, total: number, radius = PAGE_WINDOW_RADIUS): number[] | atlasPaginationJump slot: all of them up to 2 * radius + 1 pages, otherwise the first, the last and a window around current , so a list of thousands of pages stays cheap to open. |