Talisman LogoTalisman Logo Design System
Browse documentation
Components

Pagination

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.
  • Switching between views of one page. Use Tabs.
  • Showing the path to the current page. Use Breadcrumb.
  • Lists that load more as the user scrolls. Use a “Carregar mais” button.

Anatomy

Part Role
Pagination The nav landmark. Centers its content.
PaginationContent The list (ul) of items.
PaginationItem One list item.
PaginationLink A numbered page. Renders an a. isActive marks the current page.
PaginationEllipsis The “···” that stands for skipped pages. Not interactive.
PaginationFirst, PaginationPrevious, PaginationNext, PaginationLast 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

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.
  • PaginationEllipsis is aria-hidden.

Code

import {
  Pagination,
  PaginationContent,
  PaginationItem,
  PaginationLink,
} from "@repo/ui/pagination";
<Pagination aria-label="Paginação dos processos">
  <PaginationContent>
    <PaginationItem>
      <PaginationLink aria-label="Página 1" href="/cases?page=1">
        1
      </PaginationLink>
    </PaginationItem>
    <PaginationItem>
      <PaginationLink aria-label="Página 2" href="/cases?page=2" isActive>
        2
      </PaginationLink>
    </PaginationItem>
  </PaginationContent>
</Pagination>;

Props

Pagination
PropTypeDefaultDescription
aria-labelstringpaginationAccessible name of the navigation landmark. Overrides the default `pagination`; pass translated copy from the app
classNamestring—Extra classes for the `nav` element. Layout only
PaginationLink
PropTypeDefaultDescription
isActiveboolean—Marks the current page with `aria-current` and a surface background.
hrefstring—Destination of the page. Standard anchor attribute.
PaginationFirst, PaginationPrevious, PaginationNext, PaginationLast
PropTypeDefaultDescription
tooltipLabelstring—Text of the tooltip. Without it the button has no tooltip. Wrap in PaginationTooltipProvider.
disabledbooleanfalseDisables the button, for example at the first page.
aria-labelstring—Accessible name. Default is an English phrase: pass translated copy.

Known issues

Issue Effect
PaginationLink has a hover style but no focus-visible style. Keyboard users rely on the browser’s default outline, which varies between browsers and themes.
PaginationLink types a size prop but does not read it, so it reaches the a as an attribute. Setting size does nothing and adds an invalid size attribute to the link.
The default aria-label of the four navigation buttons and of Pagination are English phrases. An app that forgets to override them exposes English names to screen readers.
Tooltips use !bg-inverse !text-inverse with !important. The tooltip style cannot be changed through the Tooltip component and drifts from other tooltips.
Numbered links are not named: the visible text is only the number. Without an aria-label a screen reader says “2, link”, with no hint that it is a page.
Edit this page on GitHub