Skip to content

Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.

UIComponentsReact

Pagination

Links to the pages of a long list.

Built on the headless Pagination.See its API in Docs

Rendered by React 19.3.1

pagination.tsx

Installation

npx shadcn@4.23.0 add https://hamur.dev/r/react/pagination.json

It also adds utils, button. The app needs its setup first: Installation.

Usage

PaginationContent holds PaginationItems; each has a PaginationLink (set isActive on the current page), PaginationPrevious, PaginationNext or PaginationEllipsis. The links are Buttons, so they take its sizes.

import {
  Pagination,
  PaginationContent,
  PaginationEllipsis,
  PaginationItem,
  PaginationLink,
  PaginationNext,
  PaginationPrevious,
} from '@/components/ui/pagination'

Examples

Default

Previous, three pages, an ellipsis and next.

Its preview and code are at the top of the page.

API reference

The styled parts pass every prop to the headless part they wrap and add classes. The props, data attributes and keyboard are on Pagination's API reference.