Reference
Pagination
Pages of a list: Previous, the first and last pages, those around the current one with a gap for the rest, and Next. The current page is aria-current="page"; bind: holds it, from 1.
Pagination(bind: State, pages: Number, siblings: Number, …)
Since 6.2.0
pages
siblings
label
Showing page 4 of 12
Example
state page = 4
Pagination(bind: page, pages: 12, siblings: 1, label: "Results")
Text("Showing page {page} of 12").muted.sm
More pages around the current one
state page = 10
Pagination(bind: page, pages: 40, siblings: 2)
Props
| Prop | Type | Unset | Meaning |
|---|---|---|---|
bind: | State (required) | — | A Number state, the current page counted from 1: the buttons write it |
pages: | Number (required) | — | How many pages there are; the last button and Next stop there |
siblings: | Number | 1 | How many page buttons it shows on each side of the current one; the first and last always show, |
label: | String |
| Its accessible name ( |
Attribute families: global, aria, data. Plus the 22 universal props every element takes: animate:, exit:, speed:, duration:, delay:, easing:, stagger:, on:, count:, shared:, class:, ref:, drag:, dragGroup:, dropValue:, dropAxis:, dropInside:, roving:, trapFocus:, mount:, update:, cleanup:.
Flags and cases
A flag is written after the parentheses with a dot: a Bool prop, or a case of one of the element's enum props. A case the enum lacks is an error with a hint.
No flags of its own.
Events
Every element also takes the props, the events and the attribute families listed on every element.
Slots
It takes no slots.
Drawn for it
What Pagination draws itself, by the class a stylesheet can select. They are not written.
| Part | Class | Meaning |
|---|---|---|
Pagination.Prev | — | The previous page. |
Pagination.Next | — | The next page. |
Pagination.Page | — | A page. |
Pagination.Gap | — | The pages left out. |
Renders with the class wf-pagination, stable across releases, so a stylesheet may target it.