Build · New

Pagination

Splits long lists and tables into pages, and marks the slide showing in carousels and onboarding.

Preview

Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.

Installation

SoonInstalling from the registry opens at launch. Until then the command below is what it will be.
npx shadcn@latest add @ritla/pagination

Dependencies it brings: @base-ui/react, @phosphor-icons/react

Usage

import { Pagination } from "@/components/ui/pagination";
<Pagination pageCount={20} page={page} onPageChange={setPage} />

Examples

Minimal

The arrows and where you are ("Page 1 of 20"), for narrow spaces.

Load more

The count and a "Load more" button for feeds; the button shows its spinner and turns off on the last page.

Slide dots

PaginationDots: dot or line, two sizes, on a blurred pill over images. With onCurrentChange each dot is a button.

API reference

Pagination

PropTypeDefaultDescription
variant"numbers" | "minimal" | "load-more""numbers"Figma's Style (style is reserved in React).
pageCountnumberHow many pages there are.
page / defaultPagenumber1The current page, from 1.
onPageChange(page: number) => voidCalled with the chosen page.
hrefPatternstringPages as links, like "/orders?page={page}".
onLoadMore / loading() => void / booleanFor the load-more style.
numerals"latn" | "arab"Numeral system; defaults to KanzProvider's.

PaginationDots

PropTypeDefaultDescription
count / currentnumberHow many slides, and the current one (from 0).
onCurrentChange(index: number) => voidMakes each dot a button that moves to its slide.
variant"dot" | "line""dot"Figma's Style.
size"md" | "lg""md"Figma's Size.
framedbooleanfalseFigma's Framed: a blurred pill for use over images.

Accessibility

Keyboard

Keys are written for left-to-right. In right-to-left the arrow keys swap: the one pointing toward the reading direction moves forward.

KeyAction
TabThrough the arrows, the page numbers and the more-pages button.
EnterSpaceGoes to the page, or opens the menu of hidden pages.

ARIA

  • A nav named "Pagination" in the page language; the current page has aria-current="page".
  • The arrows are named "Previous page" and "Next page" and turn off at the ends.
  • Decorative dots come with hidden text "Slide 1 of 3"; dots as buttons are named "Go to slide 2".

Arabic and RTL notes

Mirrors

  • Page 1 sits on the right, and Next is on the left, pointing left.
  • The first dot sits on the right.

Does not mirror

  • The digits inside a number (18 stays 18).
Numerals
Page numbers and "Page 3 of 20" follow the numerals setting (0-9 or ٠-٩).
Arabic typography
body-14 Medium.

All components ›