Pagination

navigation

Page navigation with numbered buttons, prev/next arrows, ellipsis for long ranges, active page highlight, disabled boundary states, and page counter. Addresses blog pagination scalability finding from E2E Test 2.

Import

typescript
import { Pagination } from "packages/ui/src";

Props

PaginationProps

PropTypeRequired
totalPagesnumberYes
currentPagenumberNo
onPageChange(page) => void, maxVisible?: number, showCounter?: booleanNo

Examples

Navigation

Pagination

Page navigation with numbered buttons, prev/next arrows, ellipsis for long ranges, and page counter. Fifth pipeline-generated component — addresses blog scalability finding from E2E Test 2.

Blog List

Compact pagination for an EmDash blog with 8 pages of posts.

Showing page 1 of 8 · 10 posts per page

Data Table

Pagination for a 15-page data grid — ellipsis appears in the middle.

Page 5 of 15 · 25 rows per page

Long Range

100 pages — ellipsis on both sides when in the middle.

Page 10 of 100

Compact (No Counter)

Boundary States

First page (prev disabled) and last page (next disabled).

First Page

Last Page

Pipeline Story

1

Self-Healing Loop

E2E Test 2 finding: “Blog list has no pagination — works with 4 posts but won’t scale.”

2

Brain Query

NotebookLM recommended Pagination as next priority component.

3

Stitch Design

Generated via Aetheris Observatory — teal active state, dark surface.

4

Token + Component

15 pagination tokens, Pagination.tsx with ellipsis, boundary states, counter.

5

Deploy

66 tests, drift check, build, PM2 restart, all routes 200.

Metadata

Component Metadata
Familynavigation
FrameworksNext.js, Astro/EmDash
DescriptionPage navigation with numbered buttons, prev/next arrows, ellipsis for long ranges, active page highlight, disabled boundary states, and page counter. Addresses blog pagination scalability finding from E2E Test 2.
PropsPaginationProps (totalPages: number, currentPage?: number, onPageChange?: (page) => void, maxVisible?: number, showCounter?: boolean)
Statesdefault, page-active, page-hover, nav-disabled, nav-hover
A11y
  • nav element with aria-label=Pagination
  • aria-current=page on active button
  • aria-label on each page button
  • Disabled buttons have disabled attribute
Responsive
  • Centered on all breakpoints
  • Compact layout scales with button count
Motion
  • Background/color transition 150ms ease on hover
Token Dependencies
  • components.pagination.background
  • components.pagination.borderRadius
  • components.pagination.buttonBackground
  • components.pagination.buttonBackgroundHover
  • components.pagination.buttonBackgroundActive
  • components.pagination.buttonText
  • components.pagination.buttonTextHover
  • components.pagination.buttonTextActive
  • components.pagination.buttonBorderRadius
  • components.pagination.buttonSize
  • components.pagination.disabledColor
  • components.pagination.ellipsisColor
  • components.pagination.counterColor
  • components.pagination.navColor
  • components.pagination.navColorHover
Content Slots
CMS Bindings
  • Total pages from CMS collection count
  • Current page from URL parameter
Test Cases
  • Renders all page buttons
  • Highlights current page
  • Prev disabled on first page
  • Next disabled on last page
  • Shows ellipsis for long ranges
  • Fires onPageChange callback