shadcn.io is not affiliated with official shadcn/ui
Pagination examples · Advanced
End Ellipsis Pagination for React
Pagination near the start, with an ellipsis before the last page.
Near the beginning of a list: Previous, pages 1 to 3 with page 2 current, an ellipsis, the last page and Next. The ellipsis stands for the pages between 3 and 10.
Preview
Installation
FAQ
Where does the ellipsis sit in this row?
After pages 1, 2 and 3, and before the link for page 10. Page 2 has isActive. PaginationPrevious opens the row and PaginationNext closes it.
What is PaginationEllipsis here?
A span with aria-hidden and a more-horizontal icon. It is not a link. Pages 4 to 9 are not rendered. The nav is labeled "pagination".
How do I mark another page as current?
Move isActive to that PaginationLink. isActive sets the outline variant and aria-current="page". This file hardcodes the numbers, so change 1, 2, 3 and 10 yourself.
How do I give these controls real URLs?
Every href is #. Set it on PaginationPrevious, each PaginationLink, and PaginationNext.
Related
- Start Ellipsis PaginationPagination near the end, with an ellipsis
- Both Ellipsis PaginationPagination on page 6 of 20, with an
- Many Pages PaginationTen page numbers in a row with page 5 as
- Disabled State PaginationPagination on the first page, with
- Basic Data Table with CheckboxesA table of products with a checkbox on
- Complete PaginationPagination with Previous and Next, the