# Pagination

Move between pages of results, even when the total isn’t known.

- **Use it for**: Moving through pages of results, including unknown totals.
- **Not for**: Content the reader scrolls continuously. Try [DataGrid](https://unseenui.com/components/data-grid/).

## Installation

```bash
npm install @stackunseen/ui
```

## Usage

```tsx
import { Pagination } from '@stackunseen/ui';
import '@stackunseen/ui/styles.css';

<Pagination page={page} pageCount={12} onPageChange={setPage} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `disabled` | `boolean` |  |
| `getPageHref` | `(page: number) => string` | Real URLs retain native browser and modified-click behaviour. |
| `hasNextPage` | `undefined \| boolean` |  |
| `label` | `string` |  |
| `labels` | `Partial<PaginationLabels>` |  |
| `onPageChange` | `undefined \| ((page: number) => void)` |  |
| `page` (required) | `number` | One-based, host-controlled page. |
| `pageCount` | `number` |  |
| `siblingCount` | `0 \| 2 \| 1` | Numbered neighbours; rendering stays bounded even for very large totals. |

## Keyboard

Native buttons or links follow Tab order. Unavailable boundaries are disabled. Current page is identified with aria-current.

## Works with

[Table](https://unseenui.com/components/table/), [DataGrid](https://unseenui.com/components/data-grid/), [Matrix](https://unseenui.com/components/matrix/), [StatusBadge](https://unseenui.com/components/status-badge/), [CommandPalette](https://unseenui.com/components/command-palette/), [ShortcutHelp](https://unseenui.com/components/shortcut-help/), [TableOfContents](https://unseenui.com/components/table-of-contents/), [Breadcrumb](https://unseenui.com/components/breadcrumb/), [Tabs](https://unseenui.com/components/tabs/), [Stepper](https://unseenui.com/components/stepper/), [DropdownMenu](https://unseenui.com/components/dropdown-menu/), [ContextMenu](https://unseenui.com/components/context-menu/)

Page: https://unseenui.com/components/pagination/
