Page links for tables and lists, with a compact Previous / Next form for narrow spaces.
import { Pagination } from "kivu-ui"On this page
import { Pagination } from "kivu-ui";import { useState } from "react";
import { Pagination } from "kivu-ui";
export default function Demo() {
const [page, setPage] = useState(4);
return (
<div className="grid justify-items-center gap-6">
<Pagination page={page} pageCount={20} onPageChange={setPage} />
<Pagination page={page} pageCount={20} onPageChange={setPage} compact size="sm" />
</div>
);
}Extends <nav> attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
page | number | - | Required. Current page, starting at 1. |
pageCount | number | - | Required. Number of pages. |
onPageChange | (page: number) => void | - | Required. Called with the new page. |
siblings | number | 1 | Pages shown either side of the current one. |
boundaries | number | 1 | Pages always shown at the start and end. |
size | "sm" | "md" | "md" | Controls the size. |
compact | boolean | false | Only Previous / Next with “Page x of y”. |
disabled | boolean | false | Disable every button. |
Every component also accepts className and forwards its ref. Root CSS class: .kivu-pagination