Components
Page Jump
Pagination with a box to jump to any page.
<PageJump page={page} total={40} onChange={setPage} />Installation
npx shadcn@latest add https://ui.zjkm.tech/r/page-jump.jsonimport { PageJump } from "@/components/page-jump"Using JavaScript? Set tsx: false in components.json and the CLI converts it.
New to shadcn? Run npx shadcn@latest init first. The CLI needs components.json and the @/ import alias.
Usage
Previous and Next with a box to type any page number and press Enter. Numbers outside the range are clamped to the first or last page.
import { PageJump } from "@/components/page-jump";
export function Archive() {
const [page, setPage] = useState(1);
return <PageJump page={page} total={40} onChange={setPage} />;
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
page | number | The current page, from 1. | |
total | number | Number of pages. | |
onChange | (page: number) => void | Called with the new page. | |
label | string | "Pagination" | Accessible name. |
className | string | Classes for the nav. |
It has no animation, so reduced motion changes nothing.