Pagination
StablePage navigation control with configurable sibling count, optional first/last buttons, and full ARIA landmark pattern. Current page receives aria-current='page'. Previous/Next/First/Last buttons have descriptive aria-labels.
NavigationVhyxSeal
Interactive example
10-page result set — click to navigate
Import
tsx
import { Pagination } from '@vhyxui/react'Variants
With first and last page buttons
siblingCount={2} — wider page window
Without previous and next buttons
Sizes
sm, md, lg
Props
| Prop | Type | Default | Description |
|---|---|---|---|
page | number | — | Current active page (1-based). Required. |
pageCount | number | — | Total number of pages. Required. |
onPageChange | (page: number) => void | — | Called when the user navigates to a new page. Required. |
siblingCount | number | 1 | Number of sibling pages shown on each side of the current page. |
showFirstLast | boolean | false | Show first and last page buttons. |
showPrevNext | boolean | true | Show previous and next page buttons. |
size | 'sm' | 'md' | 'lg' | 'md' | Size of the pagination buttons. |
contract | Partial<ComponentContract> | — | VhyxSeal contract override. |
Accessibility
- Renders as
<nav aria-label="Pagination">— a navigable landmark. - Current page button gets
aria-current="page"per ARIA spec. - Previous/Next buttons have
aria-label="Previous page"/aria-label="Next page". - First/Last buttons have
aria-label="First page"/aria-label="Last page". - Disabled buttons (e.g. Previous on page 1) have
aria-disabled="true". - Ellipsis indicators are
aria-hidden="true"— decorative only.
Keyboard navigation
| Key | Action |
|---|---|
| Tab | Move focus through pagination buttons in order. |
| Shift + Tab | Move focus backwards through pagination buttons. |
| EnterorSpace | Activate the focused page button. |
Agent contract
Default VhyxSeal contract shipped with every Pagination.
Default contract
{
"type": "navigation",
"intent": "navigate-page",
"description": "Navigates between pages of a paginated data set",
"requires": [],
"requiredPermissions": [],
"consequence": "Changes the visible page of the data set — no data mutation",
"affects": [
"view"
],
"reversible": true,
"safetyLevel": "low",
"requiresConfirmation": false,
"destructive": false,
"contractVersion": "0.0.1",
"fingerprint": "vhyxs_6fc4415a"
}Theming
Override these CSS tokens to theme Pagination.
--vhyx-color-surfaceButton background
--vhyx-color-accentActive page background
--vhyx-color-text-on-accentActive page text color
--vhyx-color-borderButton border
--vhyx-radius-mdButton border radius
--vhyx-size-sm / md / lgButton height per size
--vhyx-duration-fastHover transition duration
Examples
Search results — large dataset
Showing results 1–10 of 2,470
247 pages with first/last buttons
Controlled pagination
tsx
const [page, setPage] = useState(1);
// Fetch data when page changes
useEffect(() => {
fetchData({ page, perPage: 20 });
}, [page]);
<Pagination
page={page}
pageCount={Math.ceil(totalItems / 20)}
onPageChange={setPage}
showFirstLast
/>