Pagination
Accessible page-based navigation with active links, previous and next controls, and skipped ranges.
Purpose
Use Pagination for finite, page-based navigation when people need to move between known result pages.
Paged navigation
Previous, next and page controls update the active page while the demo keeps the page state locally.
Installation
With the Siteplane registry alias configured, add the component and import the installed source from your app.
CLI
pnpm dlx shadcn@4.16.1 add @siteplane/paginationImport
import { Pagination } from "@/components/ui/pagination";
import { PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from "@/components/ui/pagination";Need the machine-readable source metadata? View registry JSON.
Usage
Use Pagination to move through discrete result pages. Keep current page state visible and links accessible.
import { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from "@/components/ui/pagination";
export function Example() {
return (
<Pagination>
<PaginationContent>
<PaginationItem><PaginationPrevious href="#" /></PaginationItem>
<PaginationItem><PaginationLink href="#" isActive>1</PaginationLink></PaginationItem>
<PaginationItem><PaginationNext href="#" /></PaginationItem>
</PaginationContent>
</Pagination>
);
}Examples
Active pages, navigation links, ellipsis and controlled state are compositions of the same slots.
Active page
isActive sets aria-current="page" and switches the link to the outline look.
Previous and next
Labels collapse to icon-only square buttons on small screens.
Ellipsis
The ellipsis is aria-hidden and carries a screen-reader-only "More pages" label.
Controlled with buttons
The render prop swaps the link for a button; styling comes from buttonVariants, state from useState.
API Reference
The reference lists the source-owned exports and props that are easy to miss in visual examples. Inherited Base UI props remain available unless the wrapper narrows them.
- Compose
Pagination,PaginationContentandPaginationItemas a navigation list. - Pagination is compositional and does not own page state: connect links to real routes or control the active page in the consuming app.
PaginationLinkacceptsisActiveand every Button size:xs,sm,default,lg,xl,icon-xs,icon-sm,icon,icon-lgandicon-xl.- Use
PaginationPrevious,PaginationNextandPaginationEllipsisfor navigation and skipped ranges. - Use the Base UI
renderprop on links when integrating a router without introducing nested interactive elements.
Motion
Component motion uses the shared Siteplane motion contract. See the global motion guide for provider setup, tokens and reduced-motion behavior.
- Pagination has no mount or exit animation. Hover, press and focus feedback come from the Button variant used by
PaginationLink. - The component does not require a reduced-motion override.
Accessibility
- Keep the root as a labelled
navandPaginationContentas a real list. - Set
isActiveonly on the current page soaria-current="page"remains accurate. - Preserve the built-in previous, next and ellipsis screen-reader labels.
Implementation Guidance
- Use inert links only in examples; production pagination should navigate or update controlled page state.
- Interactive demos should update
isActivefrom controlled state so previous, next and page controls demonstrate the real behavior. - Do not hand-build rows of links or buttons when the Pagination slots fit.
- Keep
aria-current,data-active, labels and Button integration intact.