A03
Warning
Accessibility
A03 — An input with no label
An Input with neither label: nor placeholder:.
What the compiler said
warning[A03]: Input missing "label" or "placeholder" attribute --> src/App.wf:4:5 | 4 | Input(bind: name).text | ^^^^^ = help: Add a label: Input(label: "Username").text = docs: https://webfluent.monzeromer.dev/errors/A03
Your editor offers this fix: Add label: "Name". wf fix --code A03 applies it to every place it fits.
The fix
Broken
page P(path: "/", title: "T", description: "D") {
state name = ""
Heading("Name").h1
Input(bind: name).text
}
Fixed
page P(path: "/", title: "T", description: "D") {
state name = ""
Heading("Name").h1
Input(bind: name, label: "Name").text
}
Input(bind: name, label: "Name"). A placeholder alone disappears as the reader types.
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": { "A03": "off" }
// wf-allow(A03)