Pagination
Pagination helps users navigate through multiple pages of content.
Import
import { Pagination } from "@raydenui/ui";Usage
Basic
<Pagination
currentPage={1}
totalPages={10}
onPageChange={(page) => setPage(page)}
/>Different Page Positions
With Sibling Count
<Pagination
currentPage={5}
totalPages={20}
siblingCount={2}
onPageChange={(page) => setPage(page)}
/>Controlled
const [page, setPage] = useState(1);
<Pagination
currentPage={page}
totalPages={10}
onPageChange={setPage}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
currentPage | number | — | Current active page (required) |
totalPages | number | — | Total number of pages (required) |
onPageChange | (page: number) => void | — | Page change handler (required) |
siblingCount | number | 1 | Pages shown on each side of current |
boundaryCount | number | 1 | Pages shown at start/end |
showPrevNext | boolean | true | Show prev/next buttons |
className | string | — | Additional CSS classes |
Accessibility
- Uses
<nav>witharia-label="Pagination" - Current page marked with
aria-current="page" - Prev/Next buttons have proper labels
- Keyboard navigation support
Last updated on