Pagination
Pagination Examples
Copy-ready examples with live previews.
Basic usage
Controlled pagination (currentPage + onPageClick), with optional jump buttons and dots separator.
Live preview
Basic
import { useState } from "react";
import Pagination from "@/packages/ui/src/_components/pagination/Pagination";
export default function Example() {
const [page, setPage] = useState(1);
return (
<Pagination
numberOfPages={10}
currentPage={page}
onPageClick={(next) => setPage(Number(next))}
showJump
showBigJump
showDots
/>
);
}Styling (variant / outline / variantRadio)
Pagination forwards Button styling props into each page/jump Button.
Live preview
Styling
import { useState } from "react";
import Pagination from "@/packages/ui/src/_components/pagination/Pagination";
export default function Example() {
const [page, setPage] = useState(6);
return (
<Pagination
numberOfPages={11}
variant="tertiary"
outline
variantRadio="pill"
showJump
showBigJump
showDots
currentPage={page}
onPageClick={(p) => setPage(Number(p))}
/>
);
}Sizes
Use Button size presets to fit different density needs.
Live preview
Sizes
import Pagination from "@/_components/pagination/Pagination";
export default function Example() {
return (
<>
<Pagination numberOfPages={7} size="small" />
<Pagination numberOfPages={7} size="medium" />
<Pagination numberOfPages={7} size="large" />
</>
);
}Large ranges
When showDots is enabled, the component renders a dots separator between two page groups.
Live preview
Large range
import { useState } from "react";
import Pagination from "@/packages/ui/src/_components/pagination/Pagination";
export default function Example() {
const [page, setPage] = useState(13);
return (
<Pagination
numberOfPages={25}
showJump
showBigJump
showDots
currentPage={page}
onPageClick={(p) => setPage(Number(p))}
/>
);
}Minimal
Render only page numbers (no jump / bigJump / dots).
Live preview
Minimal
import Pagination from "@/packages/ui/src/_components/pagination/Pagination";
export default function Example() {
return <Pagination numberOfPages={5} />;
}Interactive playground
Quick way to validate combinations (pages / variant / size / radius / outline / jumps / dots).
Live preview
Playground
import { useState } from "react";
import Pagination from "@/packages/ui/src/_components/pagination/Pagination";
export default function Example() {
const [page, setPage] = useState(1);
return (
<Pagination
numberOfPages={12}
currentPage={page}
onPageClick={(p) => setPage(Number(p))}
variant="primary"
size="small"
variantRadio="sm"
outline
showJump
showBigJump
showDots
/>
);
}On this page
Pagination Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| numberOfPages | number | Yes | — | Total number of pages (renders buttons from 1 to numberOfPages). |
| currentPage | number | No | 1 | Current selected page (used to compute prev/next when showJump is enabled). Keep it controlled in the parent. |
| onPageClick | (page: number) => void | No | — | Called when a page number or a jump control is clicked. The argument is the page that should become active. |
| showJump | boolean | No | false | Shows Prev and Next controls. |
| showBigJump | boolean | No | false | Shows First and Last controls. |
| showDots | boolean | No | false | Shows a dots separator between the two page groups. |
| variant | "primary" | "secondary" | "tertiary" | "success" | "warning" | "danger" | "info" | "transparent" | No | "transparent" | Visual variant forwarded into each internal Button (page numbers + jump controls). |
| size | "small" | "medium" | "large" | No | "small" | Button size preset forwarded into each internal Button. |
| variantRadio | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "full" | "square" | "rounded" | "pill" | No | "sm" | Button radius/shape preset forwarded into each internal Button. |
| outline | boolean | No | false | Outline style forwarded into each internal Button. |
Components