Pagination
Moves through numbered pages: previous and next, and the pages near the current one.
Stability: experimental
Props
| Prop | Type | Default | Means |
|---|---|---|---|
pages | number | How many pages there are. | |
page | number | bindable(1) | The current page, counted from 1. Bind it with bind:page={name}. |
label | string | Pages | The navigation landmark's name. |
States
| State | Looks like |
|---|---|
default | Previous, the first page, the pages either side of the current one, the last page, and next. |
current | The current page is filled with the primary colour. |
at an end | Previous on the first page and next on the last are dimmed and cannot be pressed. |
Accessibility
| role | navigation |
| name | The label prop. |
| focus | Tab reaches each button in turn. |
| keyboard | Enter and Space press them. |
| notes | The current page is marked aria-current. |
Theme tokens
color.primary color.on-primary color.ink text.label
Example
<Pagination pages={12} bind:page={page} />