The building blocks of a page navigator, numbered page links and first, previous, next and last buttons, for lists split into pages.
Stableimport { Pagination } from "@repo/ui/pagination";Source
The page links in these previews point to a section of the same page (#id). They are real anchors that can be focused and activated, without sending you to another page. In an app, links go through CustomLink, never next/link directly.
When to use
To compose a custom page navigator, for example numbered links to pages that have their own URL.
To show first, previous, next and last buttons next to something that is not a table.
When not to use
A table or list with a page size and the page kept in the URL. Use Pagination controls, which uses these parts and does the work.
Icon buttons. Disable them at the ends. Add a tooltip with tooltipLabel.
PaginationTooltipProvider
Wrap the navigation buttons in it when you use tooltipLabel.
Examples
Numbered pages
Navigation buttons
At the first page, first and previous are disabled. Hover or focus a button to see its tooltip.
Content
Name every control: the buttons contain only an icon. Pass translated aria-label and tooltipLabel, such as “Próxima página”.
Name numbered links “Página 2”, not just “2”.
Name the nav for what it pages: “Paginação dos processos”.
Use the ellipsis only between page numbers, never as a button.
Accessibility
Pagination renders a nav landmark. Its default name is the English word “pagination”: pass a translated aria-label.
Page links are anchors: Tab moves between them and Enter follows them. The current page has aria-current="page".
The four navigation buttons are Button elements: Tab focuses them and Enter or Space activates them. When disabled, they leave the tab order.
Each button has a default English aria-label (“Go to previous page”, and so on). Override it with a translated aria-label.
Tooltips come from Radix Tooltip: they show on hover and on keyboard focus, and Escape hides them. The tooltip repeats the accessible name, it does not replace it.
Buttons are 40px and links 36px wide and tall, above the 24px minimum.