# Pagination

> Moving through a long list a page at a time. Back and forward buttons with where you are between them.

| | |
|---|---|
| Kind | component |
| Contract | `review` · [pagination.contract.yaml](https://github.com/Runceanu/rost/blob/master/contracts/pagination.contract.yaml) |
| Guidance | `proposed` |
| Source | [Figma 742:43](https://www.figma.com/design/1Zy0wiWKXQAvsfDBX3KR0d/UI-Kit-v01?node-id=742-43) · read 2026-11-16 · frozen 2026-11-16 |
| Implemented in | nowhere yet |

## Install

It lands in `src/rost/pagination/`, with what it needs and its contract:

```sh
npx github:Runceanu/rost add pagination
```

Then import `src/rost/fonts.css` and `src/rost/tokens.css` once, at the root of the app. More on this in [Install](https://rost.build/docs/install.md).

## Props

| Prop | Type | Values | Default |
|---|---|---|---|
| `page` | number |  |  |
| `pages` | number |  |  |

## Anatomy

- `root`: A `<nav aria-label="Pagination">`: the back button, where you are, the forward button, 8px apart.
- `previous`: An IconButton, Secondary, with its own arrow-left. Disabled on the first page.
- `label`: "Page 3 of 12" in paragraph type, the secondary text colour, 8px clear of the buttons.
- `next`: An IconButton, Secondary, with Rost's arrow-right Icon. Disabled on the last page.

## When to use

- **Long lists.** Invoices, transactions, clients: anything longer than a screen where the order matters and people go back and forth.

## When not to use

- **Short lists.** Under fifty rows, show them all.
- **Feeds.** Something people scroll through once. Load more as they reach the end.

## Behaviour

Back, where you are, forward. I left out page numbers to jump to: in the apps people go one page at a time, and "Page 3 of 12" says enough. The buttons are disabled at either end.

## Accessibility

- **Element**: `<nav aria-label="Pagination">`, with two IconButtons labelled Previous page and Next page.
- **Name**: The buttons by what they do. The label says where you are, and `aria-live` reads the new page when it changes.
- **Keyboard**: Tab reaches the buttons; Enter or Space turns the page.
- **Colour**: The label is 11:1 on the dark page.

## Content

"Page 3 of 12", in numbers.

## Tokens

Every token this component uses, across all its variants.

| Token | Resolves to |
|---|---|
| `font-family/base` | `'General Sans Variable'` |
| `pagination/label` | `#d3d9d5` |
| `spacing/gap/small` | `8px` |
| `typography/paragraph/font-size` | `14px` |
| `typography/paragraph/font-weight/regular` | `400` |
| `typography/paragraph/letter-spacing` | `0px` |
| `typography/paragraph/line-height` | `20px` |

See it live, with every value of every variant: [rost.build/components/pagination/](https://rost.build/components/pagination/)
