shadcn.io is not affiliated with official shadcn/ui
Pagination examples · Navigation
With Page Counter Pagination for React
Previous and Next around a Page 2 of 10 counter instead of page numbers.
Previous and Next around a muted Page 2 of 10 counter. People see where they are without a row of numbers, which suits narrow screens and step-by-step reading.
Preview
Installation
FAQ
What sits between Previous and Next?
A span with the literal text "Page 2 of 10" and className="text-muted-foreground text-sm", inside a PaginationItem. It is not a PaginationLink.
Does the counter follow the current page?
No. The string is written in the file. Change the text of that span when the page changes. Nothing in this demo reads a page prop.
What do Previous and Next do here?
They are links with href="#". Default text is "Previous" and "Next", and the accessible names are "Go to previous page" and "Go to next page". The nav is labeled "pagination".
How do I point Previous and Next at real pages?
Replace each href="#" with that page's URL. The counter span has no href.
Related
- Previous and Next Only PaginationOnly Previous and Next buttons, for
- With Previous and Next PaginationThree page numbers between Previous and
- With First and Last PaginationFirst, Previous, the current page, Next
- First and Last PaginationFirst and Last links on either side of
- Both Ellipsis PaginationPagination on page 6 of 20, with an
- Disabled State PaginationPagination on the first page, with