Your semantics tree is your test API and your accessibility API at once
A testTag is invisible to a screen reader. A contentDescription is not.
We use Google Analytics to see which pages help people. No ads, no profiles. Privacy Policy
6 posts
A testTag is invisible to a screen reader. A contentDescription is not.
Compose's focus system handles keyboard, D-pad and accessibility navigation. The APIs are small, but modifier order matters, and a form with no focus handling is unusable on any device without a touchscreen.
Compose's accessibility checks catch touch targets, contrast and missing labels automatically. The failures they cannot detect — wrong labels, bad order, gesture-only actions — need a person, and knowing the split makes both cheaper.
Screen readers traverse in layout order, which breaks when a floating action button, a sticky header or a two-column layout puts visual priority somewhere else. Traversal groups and indices reorder without moving anything.
A composite component produces one semantics node per child by default, so a card becomes four swipes. mergeDescendants, clearAndSetSemantics and invisibleToUser control the shape of the tree.
Every Compose UI produces a semantics tree alongside the layout tree. It's what screen readers read, what tests query, and what autofill inspects — so getting it right serves three audiences at once.