A14

Warning

Accessibility

A14 — A role whose children are the wrong kind

A role: that requires particular children holds a control that is not one.

What the compiler said

warning[A14]: role "tablist" requires children with role "tab", but holds a Button --> src/App.wf:3:5 | 3 | Row(role: "tablist") { | ^^^ = help: Give each child role: "tab", or use the built-in that owns this structure = docs: https://webfluent.monzeromer.dev/errors/A14

The fix

Broken

wf

page P(path: "/", title: "T", description: "D") { Heading("Tabs").h1 Row(role: "tablist") { Button("One") Button("Two") } }

Fixed

wf

page P(path: "/", title: "T", description: "D") { Heading("Tabs").h1 Row(role: "tablist") { Button("One", role: "tab") Button("Two", role: "tab") } }

Give each child the role the parent requires (role: "tab"), or use the built-in that owns the structure — Tabs.

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": { "A14": "off" } // wf-allow(A14)