Reference
Footer
Repeated at the bottom of every PDF page (or those on: names), where page and pages are the page's number and the count; a <footer> on the web.
Footer(on: Enum) { … }
Before 5.0
on
all
first
rest
odd
even
No preview for this one: the example below shows how it is written.
Example
Document(title: "Invoice INV-2041") {
Footer {
Row(justify: .between) {
Text("Northwind Ltd · VAT GB123456789").muted.sm
Text("Page {page} of {pages}").muted.sm
}
}
Heading("Invoice INV-2041").h1
}
Only on the first page
Document(title: "Letter") {
Footer(on: .first) { Text("Registered in England, no. 01234567").muted.sm.center }
Heading("Dear Ada").h1
}
Props
| Prop | Type | Unset | Meaning |
|---|---|---|---|
on: | one of its cases |
| Which pages it is drawn on, in the bottom margin. Written as a flag,
|
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.
.all
.first
.rest
.odd
.even
Events
Every element also takes the props, the events and the attribute families listed on every element.
Slots
children
Renders with the class wf-footer, 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.