Navigation

Pagination for large datasets

Pagination splits long datasets into navigable windows with clear current-page cues. Use it in React tables and Next.js routes that sync page index to the URL for shareable views.

Examples

Each block uses the same Show output / Show code toggle as the variant gallery below so you can match the live UI to a copy-ready snippet.


Controlled + compact

Middle window uses siblingCount; ends use boundaryCount. Prev and Next stay keyboard-friendly on the nav region.

Current page: 7


Headless API

Current page 7 of 40. canGoPrev=true, canGoNext=true.

[
  {
    "type": "page",
    "value": 1
  },
  {
    "type": "ellipsis",
    "key": "gap-1-6"
  },
  {
    "type": "page",
    "value": 6
  },
  {
    "type": "page",
    "value": 7
  },
  {
    "type": "page",
    "value": 8
  },
  {
    "type": "ellipsis",
    "key": "gap-8-40"
  },
  {
    "type": "page",
    "value": 40
  }
]

Pagination variants examples

Each row pairs live output with matching JSX. The Variant line states which appearance/size tokens apply; pageCount, defaultPage, siblingCount, and boundaryCount stay fixed so ellipsis behavior stays visible.


Appearance: DEFAULT, Size: MD


Appearance: SECONDARY, Size: MD


Appearance: DESTRUCTIVE, Size: MD


Appearance: OUTLINE, Size: MD


Appearance: GHOST, Size: MD


Appearance: LINK, Size: MD


Appearance: GLASS, Size: MD


Appearance: EMERALD, Size: MD


Appearance: INDIGO, Size: MD


Appearance: PURPLE, Size: MD


Appearance: PINK, Size: MD


Appearance: ROSE, Size: MD


Appearance: SKY, Size: MD


Appearance: TEAL, Size: MD


Appearance: YELLOW, Size: MD


Appearance: ORANGE, Size: MD


Appearance: GRAY, Size: MD


Appearance: AMBER, Size: MD


Appearance: VIOLET, Size: MD


Appearance: GRADIENT-BLUE, Size: MD


Appearance: GRADIENT-GREEN, Size: MD


Appearance: GRADIENT-RED, Size: MD


Appearance: GRADIENT-YELLOW, Size: MD


Appearance: GRADIENT-PURPLE, Size: MD


Appearance: GRADIENT-TEAL, Size: MD


Appearance: GRADIENT-INDIGO, Size: MD


Appearance: GRADIENT-PINK, Size: MD


Appearance: GRADIENT-ORANGE, Size: MD


Appearance: SECONDARY, Size: SM


Appearance: SECONDARY, Size: MD


Appearance: SECONDARY, Size: LG


Appearance: SECONDARY, Size: XL


Appearance: SECONDARY, Size: ICON

CSS variable overrides

Pagination CSS variables

Override these pagination variables on :root, a theme selector, or a component wrapper.

107 variables

Pattern: --zui-<component>-<slot?>-<variant?>-<property>-<state?>-dark?

:root {
  --zui-pagination-list-ring-offset: oklch(98.4% 0.003 247.858);
  --zui-pagination-list-default-border: #0000001a;
  --zui-pagination-list-default-bg: #00000008;
  --zui-pagination-list-secondary-border: #0000001a;
  --zui-pagination-list-secondary-bg: oklch(96.8% 0.007 247.896 / 0.4);
  --zui-pagination-list-destructive-border: oklch(64.5% 0.246 16.439 / 0.25);
  --zui-pagination-list-destructive-bg: oklch(96.9% 0.015 12.422);
  --zui-pagination-list-outline-border: #00000026;
  --zui-pagination-list-outline-bg: transparent;
  --zui-pagination-list-ghost-border: transparent;
  --zui-pagination-list-ghost-bg: transparent;
  --zui-pagination-list-link-border: transparent;
  --zui-pagination-list-link-bg: transparent;
  --zui-pagination-list-glass-border: #00000026;
  --zui-pagination-list-glass-bg: #0000000d;
  --zui-pagination-list-emerald-border: oklch(69.6% 0.17 162.48 / 0.25);
  --zui-pagination-list-emerald-bg: oklch(97.9% 0.021 166.113);
  --zui-pagination-list-indigo-border: oklch(58.5% 0.233 277.117 / 0.25);
  --zui-pagination-list-indigo-bg: oklch(96.2% 0.018 272.314);
  --zui-pagination-list-purple-border: oklch(62.7% 0.265 303.9 / 0.25);
  --zui-pagination-list-purple-bg: oklch(97.7% 0.014 308.299);
  --zui-pagination-list-pink-border: oklch(65.6% 0.241 354.308 / 0.25);
  --zui-pagination-list-pink-bg: oklch(97.1% 0.014 343.198);
  --zui-pagination-list-rose-border: oklch(64.5% 0.246 16.439 / 0.25);
  --zui-pagination-list-rose-bg: oklch(96.9% 0.015 12.422);
  --zui-pagination-list-sky-border: oklch(68.5% 0.169 237.323 / 0.25);
  --zui-pagination-list-sky-bg: oklch(97.7% 0.013 236.62);
  --zui-pagination-list-teal-border: oklch(70.4% 0.14 182.503 / 0.25);
  --zui-pagination-list-teal-bg: oklch(98.4% 0.014 180.72);
  --zui-pagination-list-yellow-border: oklch(79.5% 0.184 86.047 / 0.25);
  --zui-pagination-list-yellow-bg: oklch(98.7% 0.026 102.212);
  --zui-pagination-list-orange-border: oklch(70.5% 0.213 47.604 / 0.25);
  --zui-pagination-list-orange-bg: oklch(98% 0.016 73.684);
  --zui-pagination-list-gray-border: oklch(55.1% 0.027 264.364 / 0.25);
  --zui-pagination-list-gray-bg: oklch(98.5% 0.002 247.839);
  --zui-pagination-list-amber-border: oklch(76.9% 0.188 70.08 / 0.25);
  --zui-pagination-list-amber-bg: oklch(98.7% 0.022 95.277);
  --zui-pagination-list-violet-border: oklch(60.6% 0.25 292.717 / 0.25);
  --zui-pagination-list-violet-bg: oklch(96.9% 0.016 293.756);
  --zui-pagination-list-gradient-blue-border: oklch(62.3% 0.214 259.815 / 0.3);
  --zui-pagination-list-gradient-blue-from: oklch(97% 0.014 254.604);
  --zui-pagination-list-gradient-blue-to: oklch(97.7% 0.014 308.299);
  --zui-pagination-list-gradient-green-border: oklch(76.8% 0.233 130.85 / 0.3);
  --zui-pagination-list-gradient-green-from: oklch(98.2% 0.018 155.826);
  --zui-pagination-list-gradient-green-to: oklch(98.6% 0.031 120.757);
  --zui-pagination-list-gradient-red-border: oklch(65.6% 0.241 354.308 / 0.3);
  --zui-pagination-list-gradient-red-from: oklch(97.1% 0.013 17.38);
  --zui-pagination-list-gradient-red-to: oklch(97.1% 0.014 343.198);
  --zui-pagination-list-gradient-yellow-border: oklch(70.5% 0.213 47.604 / 0.3);
  --zui-pagination-list-gradient-yellow-from: oklch(98.7% 0.026 102.212);
  --zui-pagination-list-gradient-yellow-to: oklch(98% 0.016 73.684);
  --zui-pagination-list-gradient-purple-border: oklch(65.6% 0.241 354.308 / 0.3);
  --zui-pagination-list-gradient-purple-from: oklch(97.7% 0.014 308.299);
  --zui-pagination-list-gradient-purple-to: oklch(97.1% 0.014 343.198);
  --zui-pagination-list-gradient-teal-border: oklch(71.5% 0.143 215.221 / 0.3);
  --zui-pagination-list-gradient-teal-from: oklch(98.4% 0.014 180.72);
  --zui-pagination-list-gradient-teal-to: oklch(98.4% 0.019 200.873);
  --zui-pagination-list-gradient-indigo-border: oklch(62.7% 0.265 303.9 / 0.3);
  --zui-pagination-list-gradient-indigo-from: oklch(96.2% 0.018 272.314);
  --zui-pagination-list-gradient-indigo-to: oklch(97.7% 0.014 308.299);
  --zui-pagination-list-gradient-pink-border: oklch(64.5% 0.246 16.439 / 0.3);
  --zui-pagination-list-gradient-pink-from: oklch(97.1% 0.014 343.198);
  --zui-pagination-list-gradient-pink-to: oklch(96.9% 0.015 12.422);
  --zui-pagination-list-gradient-orange-border: oklch(70.5% 0.213 47.604 / 0.3);
  --zui-pagination-list-gradient-orange-from: oklch(98% 0.016 73.684);
  --zui-pagination-list-gradient-orange-to: oklch(97.1% 0.013 17.38);
  --zui-pagination-ellipsis-fg: oklch(55.4% 0.046 257.417);
}

/* Dark theme variables follow the same names with -dark appended. */
.dark {
  --zui-pagination-list-ring-offset-dark: oklch(12.9% 0.042 264.695);
  --zui-pagination-list-default-border-dark: #ffffff1a;
  /* ...same variables with -dark at the end */
}

What it does

Expose aria-current on the active page where applicable.

Keep page size controls near the pager when users frequently tune density.

Composition and API

Prefer compound subcomponents instead of one oversized prop bag. Export a small, documented API for your design system.

Ensure keyboard users can move across controls without excessive tab stops.

Common use cases

  • Server-rendered tables with querystring page params.
  • Admin audit logs with thousands of rows.
  • API-backed galleries with stable page sizes.
  • Embedded widgets inside dashboards.

Accessibility

Keyboard order, focus rings, and ARIA attributes should match production usage. Test with your supported browsers and assistive technologies when semantics are non-trivial.

This preview page exposes a single h1 in the hero for a clean outline.

Next.js integration notes

Colocate examples under the App Router, keep server and client boundaries explicit, and avoid pulling interactive overlays into unexpected server layouts.

Set NEXT_PUBLIC_SITE_URL so canonical and Open Graph URLs resolve on deploy.

FAQ

Does the Pagination component work with Next.js App Router?

Yes. Import it like any other React component; keep interactive subtrees in client components when you need hooks or browser APIs, and leave static structure in server components where possible.

Can I customize pagination with Tailwind CSS?

Zentauri UI exposes class-friendly variants and slots so you can extend styles with Tailwind utilities without fighting inline styles.

Is this Pagination implementation accessible by default?

Primitives follow sensible defaults, but accessibility depends on how you label controls, manage focus, and wire keyboard handlers in your app. Validate critical flows with keyboard-only use and screen readers.