Skip to content

Pagination

Navigation

Page navigation with intelligent ellipsis.

atlas-pagination

Examples

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

InputTypeDefaultDescription
totalPages requirednumber— Number of pages.
currentPage two-waynumber1 The current page, 1-based (two-way).
siblingCount number1 Page buttons shown on each side of the current page before an ellipsis.
showFirstLastButtons booleantrue Shows the first-page and last-page buttons.
compact booleanfalse Fits a phone (about 340px): previous, "Page X of Y", next, with no page or first/last buttons. Project an element with the atlasPaginationJump attribute, such as an atlas-select , to replace the text with a jump control.
class string'' Extra CSS classes, merged with the component's own through cn() ; yours win on conflicts.

Functions

FunctionDescription
pageWindow(current: number, total: number, radius = PAGE_WINDOW_RADIUS): number[] Page numbers for a page select, such as one in the 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.