Menu

Pagination

Page navigation. 3 styles.

Installation

$ npx uix-ui@latest add pagination

This copies the file into components/ui/pagination.tsx in your project. npx shadcn@latest add @uix/pagination works too.

Usage

pagination.tsx
import { Pagination } from "@/components/ui/pagination";

<Pagination page={page} pageCount={9} onPageChange={setPage} />

Props

PropTypeDefaultDescription
appearanceoutline | ghost | filled"outline"
pagenumber–Current page, starting at 1.
pageCountnumber–
onPageChange(page: number) => void–
siblingsnumber1Pages shown on each side of the current one.

Everything else is passed to the root element, so className, aria-* and event handlers work as usual.

Dependencies

Installed for you by the CLI.

  • class-variance-authority
  • clsx
  • tailwind-merge
  • lib/utils.ts
  • components/ui/icons.tsx
esc

↑↓ to navigate · ↵ to select · esc to close