shadcn.io is not affiliated with official shadcn/ui
Pagination examples · Basic
Simple Page Numbers Pagination for React
Three page numbers with page 2 as the current page, and no other controls.
The smallest pagination: three page numbers with page 2 current. Use it for a short set of pages where Previous and Next would add more than they help.
Preview
Installation
FAQ
What does this simple row render?
Three PaginationLinks, numbered 1, 2 and 3. Page 2 has isActive. There is no Previous, Next, or ellipsis, and PaginationContent has no gap class.
How does isActive change page 2?
It selects the outline variant and sets aria-current="page". Pages 1 and 3 stay ghost. Move isActive to the link that should be current.
How do I link 1, 2 and 3 to real URLs?
Each href is #. Set it to that page's URL. Pagination is a nav labeled "pagination".
How do I tighten or loosen the three links?
Put a gap class on PaginationContent. This file does not, so the gap comes from the cn-pagination-content style (gap-0.5 or gap-1, depending on the style).
Related
- Five Page Numbers PaginationFive page numbers with the middle one
- With Previous and Next PaginationThree page numbers between Previous and
- Complete PaginationPagination with Previous and Next, the
- Basic TabsFour horizontal tabs that switch between
- Breadcrumb with Ellipsis (Standard)A breadcrumb trail with a text Home link
- With Ellipsis PaginationPage numbers with an ellipsis before the