shadcn.io is not affiliated with official shadcn/ui
Pagination examples · Sizes
Small Size Pagination for React
Pagination with small page buttons and a tight gap, for dense tables.
Previous, three page numbers and Next at the small button size, close together. Use it in table footers and dense dashboards where the default size takes too much room.
Preview
Installation
FAQ
How is the row made small?
PaginationPrevious and PaginationNext take size="sm", the page links size="icon-sm": the small button sizes. PaginationContent takes gap-0.5 to bring them closer.
How is the current page marked?
isActive on page 2 gives it the outline style and aria-current="page". The other numbers are ghost links.
Are the small buttons big enough to tap?
They are meant for pointer-heavy screens such as dashboards. On touch screens, use the default or large size so each target is easier to hit.
How do I change the Previous and Next words?
Pass text. The defaults are Previous and Next, and the accessible names are Go to previous page and Go to next page. The word is hidden below the sm breakpoint, where only the chevron shows.
Related
- Default Size PaginationPagination at the default size, with
- Large Size PaginationPagination with large page buttons and a
- Compact PaginationThree page numbers packed close together
- Many Pages PaginationTen page numbers in a row with page 5 as
- Basic Data Table with CheckboxesA table of products with a checkbox on
- Button with Text (Standard)The one filled action