Pagination

Page navigation with smart ellipses, jump controls and a quick-jump input.

Import#

import { Pagination } from "astralis-ui";
// Pagination.List, .Pages, .Item, .Prev, .Next,
// .First, .Last, .PageText, .Jumper

Variants#

solid
outline
subtle
plain

Everything on#

Derive the page count from an item count + pageSize, pin boundary pages, and compose every control — Pages handles the ellipses automatically.

Controlled#

page + onPageChange for server-driven data — the usual case.

Fetching results for page 1

Props#

PropTypeDefaultDescription
page · defaultPage · onPageChangenumber · number · (page: number) => void— · 1 · —Controlled / initial page, and the change callback.
totalPagesnumberExplicit page count — use this OR count + pageSize.
count · pageSizenumber · number— · 10Total items; the page count is derived.
variant"solid" | "outline" | "subtle" | "plain""solid"Page-button styling; the active page carries the accent.
size"xs" | "sm" | "md" | "lg""md"Button sizing.
rounded"none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full""md"Button corner radius.
colorScheme"brand" | "gray" | … (all 11 schemes)"brand"Active page and focus-ring hue.
disabledbooleanfalseDisables the whole control.

Parts#

PropTypeDefaultDescription
Pagination.Pagessiblings?: number · boundaryCount?: number1 · 1Page buttons around the current page and pinned at the ends, with ellipses between.
Pagination.Prev / Next / First / Lasticon?: ReactNodeStep and jump buttons; default chevron icons.
Pagination.PageTextformat?: (state) => ReactNode"Page 3 of 8"Live-region readout of the current state.
Pagination.Jumperlabel?: ReactNode"Go to"Number input that jumps straight to a page.
Pagination.Itempage: numberA single page button, for fully manual layouts.

Keyboard#

KeyAction
TabMove between the page and prev/next buttons
Enter / SpaceActivate the focused button
Enter in the JumperJump to the typed page (clamped to range)

Accessibility#

  • Renders a nav landmark labeled "Pagination"; the active page carries aria-current="page".
  • PageText is an aria-live region, so page changes are announced.
  • The Jumper input has an accessible label and clamps to valid pages.