shadcn.io is not affiliated with official shadcn/ui
Pagination examples · Sizes
Compact Pagination for React
Three page numbers packed close together with a smaller gap.
Three page numbers with page 2 current, closer together than the default. Use it in table footers and side panels where width is tight.
Preview
Installation
FAQ
What does this compact row render?
Three PaginationLinks, for pages 1, 2 and 3. There is no PaginationPrevious or PaginationNext. Page 2 has isActive.
Where does the tight spacing come from?
PaginationContent has className="gap-0.5". That is the only spacing class in the file. The links stay inside PaginationItems on that list.
How is the current page marked?
isActive on the page 2 link selects the outline variant and sets aria-current="page". The other two links stay ghost. Move isActive when the current page changes.
How do I link these numbers to real pages?
Each PaginationLink has href="#". Replace # with that page's URL. Pagination is a nav labeled "pagination".
Related
- Spacious PaginationThree page numbers spread apart with a
- Small Size PaginationPagination with small page buttons and a
- Many Pages PaginationTen page numbers in a row with page 5 as
- Basic Button GroupThree rows of outline buttons joined into
- Standard CarouselA basic carousel of five numbered slides
- Default Size PaginationPagination at the default size, with