A05
Warning
Accessibility
A05 — A button with no text
A Button with no text: no label, no aria-label:, and no Text in its block.
What the compiler said
warning[A05]: Button has no text content --> src/App.wf:3:5 | 3 | Button { Icon("check") } | ^^^^^^ = help: Add text: Button("Save").primary = docs: https://webfluent.monzeromer.dev/errors/A05
The fix
Broken
page P(path: "/", title: "T", description: "D") {
Heading("Actions").h1
Button { Icon("check") }
}
Fixed
page P(path: "/", title: "T", description: "D") {
Heading("Actions").h1
Button { Icon("check") Text("Save") }
}
Give it text — Button("Save"), or a Text in its block beside
the icon, Button { Icon("check") Text("Save") } — or an aria-label:
when it shows only an icon. A Text anywhere in the block names it — in a
branch, in a component the block places, or reading state; a Tooltip's
words, which show only on hover, do not.
Each example is a whole program: it is all of src/App.wf in a project with no other .wf file (trying an example).
lints may lower it:
"lints": { "A05": "off" }
// wf-allow(A05)