Skip to content
LoidoltTheme 0.11.1
Svelte 5

Component

Pagination

Page controls over a total item count.

import { Pagination } from '@loidolt/theme-svelte';

Example

Showing page 4 of 25

Notes

  • count is the number of items, not the number of pages.
  • The ellipsis is aria-hidden: read between page numbers it is noise, and the buttons either side already say where the trail jumps.

Props

Generated from the component source, so it cannot drift from the implementation.

Pagination props
PropTypeDefaultNotes
count required number—Total number of items being paged through — not the number of pages.
class string—
label string'Pagination'Accessible name of the landmark.
nextLabel string'Next'
onPageChange (page: number) => void—
page bindablenumber11-based current page.
pageLabel (page: number) => string(value: number) => `Page ${value}`Accessible name for a page button, e.g. (page) => Page ${page}.
perPage number10
previousLabel string'Previous'
ref bindableHTMLElement | nullnull
siblingCount number1Pages kept either side of the current one before the trail turns into an ellipsis.

Plus the attributes of Omit<HTMLAttributes<HTMLElement>, 'children'>, forwarded to the root element.