Pagination

molecules

Page number navigator with prev/next. URL-driven (controlled). Compact mode for tables, full mode for grids.

ARIA Role: navigation

Demo

Demo for Pagination (molecules)

Page number navigator with prev/next. URL-driven (controlled). Compact mode for tables, full mode for grids.

Props

PropTypeRequiredDefaultDescription
currentPagenumberYes1-based, must be 1..totalPages
totalPagesnumberYesMust be ≥1
onPageChange(page: number) => voidYes

TypeScript Interface

interface PaginationProps {
  currentPage: number;
  totalPages: number;
  onPageChange: (page: number) => void;
  siblingCount?: number;
  showFirstLast?: boolean;
  ariaLabel: string;
}

Assertions (NASA Rule 5)

  • [type]currentPage in [1, totalPages]; totalPages ≥1 (NASA Rule 7)(NASA Rule 7)
  • [aria]<nav aria-label>; current page button has aria-current='page'(WAI-ARIA Pagination Pattern)

Usage

Import

import { Pagination } from '@epasslive/design-system'

Basic

<Pagination />

With Variants

<Pagination variant="primary" size="md" />