Skip to content
shadcn.io is not affiliated with official shadcn/ui

Shadcn Pagination for React and Tailwind

Navigate through a list of items.

Installation

bunx --bun shadcn@latest add https://kit.dev/r/pagination.json

Anatomy

Pagination
├── PaginationPrevious
├── PaginationItems
└── PaginationNext

Usage

import {
  Pagination,
  PaginationItems,
  PaginationNext,
  PaginationPrevious,
} from "@/components/ui/pagination";
<Pagination>
  <PaginationPrevious />
  <PaginationItems />
  <PaginationNext />
</Pagination>

Controlled

Use page and onPageChange to control the current page.

Examples

Page Range

Use page and pageSize properties to show which items are visible.

Under development

Table

Use Pagination with Table to paginate a table.

API Reference

Pagination

PropTypeDefault
countnumber-
pagenumber-
defaultPagenumber1
pageSizenumber-
defaultPageSizenumber10
siblingCountnumber1
onPageChange(details: PageChangeDetails) => void-
onPageSizeChange(details: PageSizeChangeDetails) => void-

For a complete list of props, see the Ark UI documentation.