Reference
PrevNext
The pages before and after this one in an ordered set — a guide's chapters: each a link that says which way it goes and the page's title.
PrevNext(label: String) { … }
Since 6.2.0
Example
PrevNext {
PrevNext.Prev("Forms", to: "/learn")
PrevNext.Next("Data and requests", to: "/learn/15-data")
}
The last page: only the way back, in your words
PrevNext(label: "More of the guide") {
PrevNext.Prev("Recipes", to: "/recipes", label: "Back to")
}
Props
| Prop | Type | Unset | Meaning |
|---|---|---|---|
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
children
Parts
The parts of PrevNext are written under its name, inside it. Each is described here, with what it takes.
PrevNext.Prev
The page before: its title, and where it is.
PrevNext.Prev(_ title: String, to: Path, label: String)
| Prop | Type | Unset | Meaning |
|---|---|---|---|
title | String (positional) | — | The previous page's title, shown bold under the word |
to: | Path (required) | — | The route of the previous page, linked with |
label: | String |
| The small word above the title |
PrevNext.Next
The page after: its title, and where it is.
PrevNext.Next(_ title: String, to: Path, label: String)
| Prop | Type | Unset | Meaning |
|---|---|---|---|
title | String (positional) | — | The next page's title, shown bold under the word |
to: | Path (required) | — | The route of the next page, linked with |
label: | String |
| The small word above the title |
Renders with the class wf-prev-next, stable across releases, so a stylesheet may target it.
Codes this can raise
These controls list the props' cases; the example below shows them written.