Prodular UI

Pagination

Page links for long lists and tables, with previous and next controls and a raised current page.

npx prodular-ui add pagination

Numbered

First, last and the pages around the current one. Gaps collapse to an ellipsis.

Anatomy

<Pagination>  <PaginationContent>    <PaginationItem><PaginationPrevious href="?page=3" /></PaginationItem>    <PaginationItem><PaginationLink href="?page=4" isActive>4</PaginationLink></PaginationItem>    <PaginationItem><PaginationNext href="?page=5" /></PaginationItem>  </PaginationContent></Pagination>

Guidance

Use it when

  • Tables and lists with more rows than fit comfortably, where people need to know their position.
  • The footer of a table card, aligned right.

Avoid

  • Feeds and activity logs that people scroll through. Load more on scroll instead.
  • Showing every page number. Show at most seven slots.

Rules for AI agents

Published in llms-full.txt, the registry and the MCP server, so coding agents follow them when they build with this component.

  • Mark the current page with isActive. It renders aria-current="page".
  • Show the first page, the last page and one page on each side of the current one. Fill gaps with PaginationEllipsis.
  • Give every PaginationLink an href, or render it with a router link.
  • In a table card, put Pagination in CardFooter with className="mx-0 w-auto" and a 13px range summary on the left.
  • Format totals with thousands separators: 1,284.

API

PaginationLink

PropTypeDefaultDescription
isActivebooleanfalseMarks the current page.
sizeButton size"icon"Button size for the link.

PaginationPrevious

PropTypeDefaultDescription
textstring"Previous"Label. Hidden below the sm breakpoint.

PaginationNext

PropTypeDefaultDescription
textstring"Next"Label. Hidden below the sm breakpoint.

Installation

The Prodular UI CLI adds the source to components/ui with everything it depends on. In a project that already uses shadcn/ui, the shadcn CLI installs it from the Prodular registry too. See Installation for the first setup.

npx prodular-ui add pagination# or, with the registry in components.jsonnpx shadcn@latest add @prodular/pagination