Toolbox-XToolbox-X

Page Navigation Methods

Methods for navigating between pages, checking boundaries, and generating page lists.

nextPage()

nextPage(): number | null

Returns the next page number, or null if already on the last page.

playground.ts

prevPage()

prevPage(): number | null

Returns the previous page number, or null if already on the first page.

playground.ts

isFirstPage()

isFirstPage(): boolean

Returns whether the current page is the first page.

playground.ts

isLastPage()

isLastPage(): boolean

Returns whether the current page is the last page.

playground.ts

hasPrevPage()

hasPrevPage(): boolean

Returns whether a previous page exists.

playground.ts

hasNextPage()

hasNextPage(): boolean

Returns whether a next page exists.

playground.ts

firstPage()

firstPage(): number

Returns the first page number (always 1).

playground.ts

lastPage()

lastPage(): number

Returns the last page number.

playground.ts

pageList()

pageList(options?: PageListOptions): number[]

Generates an array of page numbers for UI display.

Parameters

ParameterTypeDescription
optionsPageListOptions (optional)Configuration for page list generation.
interface PageListOptions {
  edgeCount?: number; // default: 1
  siblingCount?: number; // default: 1
}

Behavior

  • Always shows first/last edgeCount pages.
  • Shows siblingCount pages around current page.
  • Merges overlapping ranges.

Example

playground.ts

Last updated: Sun, Jun 14, 2026 07:15:25PM (UTC)

On this page