Xzero UI
Pro library

Pagination

Move through a long collection with clear bounds.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/pagination
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/pagination

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { useState } from "react";
import { Pagination } from "@/components/xzero/pagination/pagination";

export function Results() {
  const [page, setPage] = useState(1);
  return <Pagination page={page} pageCount={12} onPageChange={setPage} />;
}

API reference

Pagination

Previous and next buttons around a sliding five page window with a traveling current page mark.

PropTypeDefaultDescription
page (required)number–Current page, 1-based. Clamped to the range.
pageCount (required)number–Total pages. Zero renders an empty nav.
onPageChange (required)(page: number) => void–Called with the requested page.
labelstring"Pagination"Accessible name for the nav landmark.

Keyboard interactions

KeysAction
TabMoves between the previous, page, and next buttons.
Enter / SpaceGoes to that page.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in navigation

Guidance for AI tools

Pagination: Move through a long collection with clear bounds. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components