Skip to main content
Version: latest
Works everywhere

Pagination works in both server and client environments. Always use the standard import (e.g. @prokodo/ui/pagination) — the library detects the runtime automatically.

Pagination

Pagination renders a page navigation strip. It handles large page counts by showing a configurable window of pages with ellipsis on either side.

Live demo →

Overview

import { Pagination } from "@prokodo/ui/pagination"
;<Pagination
page={currentPage}
count={totalPages}
onChange={page => setCurrentPage(page)}
/>

Import

import { Pagination } from "@prokodo/ui/pagination"

CSS:

import "@prokodo/ui/pagination.css"

Props

PropTypeDefaultRequiredDescription
totalPagesnumberTotal number of pages.
currentPagenumber1Controlled current page.
boundaryCountnumber1Number of always-visible pages at each boundary.
readOnlybooleanfalseDisable interactive page change.
translationsPaginationTranslationsOverride default label strings.
onPageChange(page: number) => voidCalled when the current page changes.
onPrev() => voidCalled when the previous button is clicked.
onNext() => voidCalled when the next button is clicked.
classNamestringCSS class on root element.

See src/components/pagination/Pagination.model.ts for the full PaginationProps type.


AIC Note

Use the standard import path in application code:

import { Pagination } from "@prokodo/ui/pagination"

No separate /client or /lazy import selection is required in consumer code.

AIC components also support a priority flag for critical above-the-fold elements. This is most visible on Image (native preloading via <link rel="preload"> for above-the-fold content).


WCAG 2.2 Status

CriterionNameStatusNote
1.3.1Info and Relationships (A)✅ FulfilledSemantic structure (headings, lists, labels, landmarks) must be conveyed programmatically via HTML or ARIA.
2.1.1Keyboard (A)✅ FulfilledAll functionality must be operable via keyboard alone, without requiring specific timing.
2.4.4Link Purpose (In Context) (A)🔍 Manual reviewThe purpose of every link must be determinable from the link text alone, or from its surrounding context.
2.4.7Focus Visible (AA)🔍 Manual reviewA visible keyboard focus indicator must be present on every interactive element. Verify against the applied product theme.
2.4.11Focus Not Obscured (Min.) (AA)🔍 Manual reviewThe focused component must not be fully hidden by sticky headers, overlays, or other positioned page elements.
2.5.8Target Size (Minimum) (AA)🔍 Manual reviewInteractive target areas must be at least 24 × 24 CSS pixels. Verify in the integrated product UI.
4.1.2Name, Role, Value (A)✅ FulfilledName, role, and state of all interactive UI components must be programmatically determinable via native HTML semantics or ARIA.

Test coverage: 3 jest-axe assertion(s) across 5 test file(s) · 6 ARIA attribute occurrence(s) in source scan. Criteria marked 🔍 require manual verification in the final product integration and theme context.


Design Tokens

Customise Pagination via CSS custom properties on :root or a scoped ancestor.

TokenDefaultDescription
--pk-pagination-gapvar(--pk-space-sm)Gap between pagination items
--pk-pagination-fgcolor-mix(in srgb, var(--pk-color-fg) 70%, transparent)Text color for ellipsis and inactive page numbers
--pk-pagination-page-radius10pxBorder-radius of page number buttons
--pk-pagination-pad-xvar(--pk-space-xs)Horizontal padding of page number buttons
--pk-pagination-active-bordervar(--pk-color-brand)Color used for the active page glow shadow (overridden per color)
--pk-pagination-active-shadow0 4px 18px color-mix(in srgb, brand 45%, transparent)Drop-shadow on the active page button
--pk-pagination-active-gradientvar(--gradient-border-4)Gradient applied to the active page border ring (overridden per color)

Storybook

👉 Open Pagination in Storybook


Source

src/components/pagination/Pagination.model.ts