Duolith docs

Pagination

Moves through numbered pages: previous and next, and the pages near the current one.

Stability: experimental

Props

PropTypeDefaultMeans
pagesnumberHow many pages there are.
pagenumberbindable(1)The current page, counted from 1. Bind it with bind:page={name}.
labelstringPagesThe navigation landmark's name.

States

StateLooks like
defaultPrevious, the first page, the pages either side of the current one, the last page, and next.
currentThe current page is filled with the primary colour.
at an endPrevious on the first page and next on the last are dimmed and cannot be pressed.

Accessibility

rolenavigation
nameThe label prop.
focusTab reaches each button in turn.
keyboardEnter and Space press them.
notesThe current page is marked aria-current.

Theme tokens

color.primary color.on-primary color.ink text.label

Example

<Pagination pages={12} bind:page={page} />