Back to Shark UI

Pagination

docs/components/pagination

latest6.4 KB
Original Source

Sections

Components

Utilities

Forms

Hooks

Pagination

Copy Markdown

Navigate through a list of items.

DocsAPI

PreviewCode

Installation#

CLIManual

pnpmbunnpmyarn

pnpm dlx shadcn@latest add @shark/pagination

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.

PreviewCode

Page 1 of 5

Examples#

Page Range#

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

PreviewCode

Under development

Table#

Use Pagination with Table to paginate a table.

PreviewCode

NameEmail
User 1[email protected]
User 2[email protected]

Items per page:

234

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.

[

Previous page

Number Input ](/docs/components/number-input)[

Next page

Password Input ](/docs/components/password-input)

On This Page

InstallationAnatomyUsageControlledExamplesPage RangeWith LinksTableAPI ReferencePagination