shadcn.io is not affiliated with official shadcn/ui
Pagination examples · Basic
Five Page Numbers Pagination for React
Five page numbers with the middle one, page 3, as the current page.
Pages 1 to 5 with page 3 current and no other controls. Use it when the whole set fits in five pages, such as a short gallery or a multi-page form.
Preview
Installation
FAQ
Which page links does this row render?
Five PaginationLinks, numbered 1 through 5. Page 3 has isActive. There is no PaginationPrevious, PaginationNext, or PaginationEllipsis.
How is page 3 shown as current?
isActive selects the outline variant and sets aria-current="page". The other four links stay ghost. Move isActive to mark a different link.
How do I show a different run of five pages?
The numbers are hardcoded. Replace 1, 2, 3, 4 and 5, and put isActive on the current one. PaginationContent has no extra gap class in this file.
How do I link each number to its page?
Every href is #. Set each PaginationLink's href to that page's URL. The nav is labeled "pagination".
Related
- Simple Page Numbers PaginationThree page numbers with page 2 as the
- With Previous and Next PaginationThree page numbers between Previous and
- With Ellipsis PaginationPage numbers with an ellipsis before the
- Complete PaginationPagination with Previous and Next, the
- Both Ellipsis PaginationPagination on page 6 of 20, with an
- Disabled State PaginationPagination on the first page, with