Navigation
Pagination <pm-pagination>
Pagination. Give pages, or total items with page-size. Buttons by default; links with href-template.
Variants
Set with the variant attribute.
variant="full"variant="simple"Sizes
Set with the size attribute; controls keep touch-sized targets on phones.
size="sm"size="md"size="lg"Tones
Set tone on the element, or data-tone on any ancestor to tone a whole area.
tone="accent"tone="secondary"tone="neutral"tone="success"tone="warning"tone="danger"tone="info"States
Each state is one attribute.
DisabledAttributes
| Attribute | Type | Default | Description |
|---|---|---|---|
prev-labelprop: prevLabel | string | — | Text of the previous button (default "Previous"; its name is "Previous page"), for another language. |
next-labelprop: nextLabel | string | — | Text of the next button (default "Next"; its name is "Next page"). |
page | number | 1 | Current page (1-based). |
pages | number | — | Number of pages (or use total + page-size). |
total | number | — | Total number of items. |
page-sizeprop: pageSize | number | 10 | Rows per page, used with total to count pages. |
siblings | number | 1 | Pages shown either side of the current one. |
boundaries | number | 1 | Pages always shown at the start and end. |
variant | 'full' | 'simple' | full | simple: Previous · Page x of y · Next. |
href-templateprop: hrefTemplate | string | — | Render links, e.g. "?page={page}". |
label | string | Pagination | Accessible name (and visible label where the component shows one). |
disabled | boolean | false | Every page control is disabled (e.g. while a page loads). |
size | 'sm' | 'md' | 'lg' | — | Control size. |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Events
| Event | React / Svelte prop | Description |
|---|---|---|
pm-change | onPmChange | Page changed. |
Methods
goTo()