Expand description
a11y-kit — the accessibility semantics layer (ADR-0004 §2; the keystone nobody in the ecosystem funds).
A platform-free semantic node model — role, accessible name, states, relations — plus a tree audit that runs headlessly in CI. Every toolkit lowers into this; none of them ship the gate.
use a11y_kit::{A11yNode, A11yRole, A11yTree, NodeId, Relation, States};
let mut tree = A11yTree::new();
let root = tree.push(A11yNode::new(NodeId(0), A11yRole::Window, "Chisel Docs"));
let panel = tree.push(
A11yNode::new(NodeId(1), A11yRole::Group, "Tool palette")
.with_parent(root)
.with_states(States { focused: true, ..States::default() }),
);
let save = tree.push(
A11yNode::new(NodeId(2), A11yRole::Button, "Save document")
.with_parent(panel)
.with_relation(Relation::LabelledBy(panel)),
);
assert!(tree.audit().is_ok(), "a well-formed tree passes");§The rules the audit enforces
- ids are unique;
- parents/relations resolve;
- no parent cycles;
- every interactive role carries an accessible name;
- at most one focused node, and it must live inside a
Windowsubtree (a focusable node floating as its own root is invisible to the screen reader).
§AccessKit
Conversion into AccessKit’s transport types lands behind the accesskit
feature (Wave 2.1, first toolkit adapter). The audit layer stays
dependency-free so any CI can run it — including this repo’s.
Structs§
- A11y
Node - One semantic node.
- A11y
Tree - An insertion-ordered tree of semantic nodes.
- NodeId
- A stable node identity within one tree.
- States
- Node state flags.
- Tree
Audit - What an audit measured.
Enums§
- A11y
Role - The semantic roles the estate’s controls map onto. Deliberately a toolkit-neutral subset of the ARIA/accesskit role vocabulary — the lowering adapters pick the framework’s spelling.
- Audit
Error - Why an accessibility tree failed its audit.
- Relation
- A relation between nodes (the edges a screen reader traverses).
- TriState
- Tri-state checkbox value.
Constants§
- VERSION
- The crate’s version, for callers that report it.
Functions§
- is_
interactive - True for roles a keyboard user must be able to reach and operate — roles whose accessible name the audit requires.