Skip to content

Pagination

Moves between pages of a table, list or document. Shows page numbers, a compact previous and next with "Page 2 of 10", or cards linking to the previous and next article.

// Plain markup
import { Pagination } from "@shavin/ui";

Numbered (default)

Current Page: 3 of 10
Component Source
const [page, setPage] = useState(3);

<Pagination page={page} totalPages={10} onPageChange={setPage} />

Simple

Component Source
<Pagination variant="simple" page={page} totalPages={5} onPageChange={setPage} />

Cards

Component Source
<Pagination
  variant="cards"
  prevTitle="Foundations Overview"
  nextTitle="Typography Overview"
/>

Props

PropTypeDefaultDescription
pagenumber1Current active page (1-indexed). Default 1.
totalPagesnumber1Total number of pages. Default 1.
onPageChange(page: number) => void—Callback fired when a page is selected.
prevLabelstringPreviousCustom label for previous button/link. Default "Previous".
nextLabelstringNextCustom label for next button/link. Default "Next" or "Up next".
prevTitlestring—Title text for previous item (used in "cards" variant).
nextTitlestring—Title text for next item (used in "cards" variant).
prevHrefstring—Href link for previous card/button (optional, enables link mode).
nextHrefstring—Href link for next card/button (optional, enables link mode).
variant"numeric" | "simple" | "cards""numeric"—
size"sm" | "md" | "lg""md"—
Configure Theme
Theme
Brand Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font