Accessibility
Use when building or changing any user-facing UI — a component, form, modal, menu, icon button, custom control, colour or focus style — on web, iOS, or Android. Also use when auditing for WCAG compliance, when a design uses colour alone to carry meaning, when adding a click handler to something that isn't a button, and when asked about screen readers, keyboard navigation, contrast, or target size.From its SKILL.md
npx -y skills add m-de-graaff/skills --skill accessibilityAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
8.7 KB, as published. Nobody here has run it
Accessibility (WCAG 2.2 AA)
Interfaces that work for people using screen readers, switch controls, keyboards, magnification, or no pointer at all.
Core principle: use the native element. A <button>, a SwiftUI Button, an Android
Button arrives with focus, keyboard activation, role, and state already correct. Every
accessible custom control is a reimplementation of one of those, and most of them are worse.
The order to work in
- Role — what is this, functionally? Reach for the semantic native element first. Only build a custom control when no native one has the behaviour.
- Name — every interactive element and every meaningful image needs one. Icon-only controls need an explicit label; the icon itself must be hidden from assistive tech.
- State and value — pressed, expanded, selected, checked, invalid, busy. Announced, not just drawn.
- Operability — reachable by keyboard, big enough to hit, visible when focused.
- Feedback — errors and dynamic changes reach the user without a visual scan.
Name, role, value is the contract. If any of the three is missing or wrong, the control is broken for assistive tech regardless of how it looks.
WCAG 2.2 AA, the parts people actually miss
| Criterion | Level | Requirement |
|---|---|---|
| 1.4.3 Contrast (Minimum) | AA | 4.5:1 body text, 3:1 for text ≥24px (or ≥19px bold) |
| 1.4.11 Non-text Contrast | AA | 3:1 for UI component boundaries, icons, and focus indicators |
| 1.4.10 Reflow | AA | Usable at 320 CSS px wide with no two-axis scrolling |
| 2.4.7 Focus Visible | AA | The keyboard focus indicator is visible |
| 2.4.11 Focus Not Obscured | AA, new in 2.2 | Sticky headers and toolbars must not fully hide the focused element |
| 2.5.7 Dragging Movements | AA, new in 2.2 | Anything draggable needs a single-pointer alternative — a tap target, a menu, arrow keys |
| 2.5.8 Target Size (Minimum) | AA, new in 2.2 | 24×24 CSS px, or adequate spacing between smaller targets |
| 3.2.6 Consistent Help | A, new in 2.2 | Help mechanisms appear in the same relative order on every page |
| 3.3.3 Error Suggestion | AA | Say how to fix it, not just that it's wrong |
| 3.3.7 Redundant Entry | A, new in 2.2 | Don't ask for the same information twice in one process |
| 3.3.8 Accessible Authentication | AA, new in 2.2 | No cognitive function test (puzzle, memorised password recall, transcription) without an alternative. Allow paste and password managers |
Focus Appearance (2.4.13) is AAA, not AA. It specifies the indicator's minimum area and contrast. Worth doing; don't claim AA conformance rests on it, and don't skip 2.4.7 because you did 2.4.13.
4.1.1 Parsing was removed in WCAG 2.2. Duplicate IDs and unclosed tags still break assistive tech in practice — they're just no longer a conformance failure.
Target size across platforms
The numbers differ and getting them wrong fails an audit:
| Platform | Minimum | Source |
|---|---|---|
| Web | 24×24 CSS px (spacing exception applies) | WCAG 2.2 SC 2.5.8 |
| iOS | 44×44 pt | Apple HIG |
| Android | 48×48 dp | Material / Android a11y guide |
Native platform guidance is stricter than WCAG here. Meet the platform's number.
Cross-platform mapping
| Need | Web | iOS (SwiftUI) | Android (Compose) |
|---|---|---|---|
| Name | <label>, or aria-label when no visible text | .accessibilityLabel() | contentDescription |
| Description | aria-describedby | .accessibilityHint() | stateDescription |
| Role | native element, else role="button" | .accessibilityAddTraits(.isButton) | semantics { role = Role.Button } |
| Live updates | aria-live="polite" | .accessibilityLiveRegion(.polite) | semantics { liveRegion = LiveRegionMode.Polite } |
| Hide decoration | aria-hidden="true" | .accessibilityHidden(true) | contentDescription = null |
| Group as one | role="group" + label | .accessibilityElement(children: .combine) | semantics(mergeDescendants = true) |
Example — an icon-only control, done three ways
The single most common defect, and the same fix everywhere: the control gets a name, the icon is hidden so it isn't announced twice.
<button type="submit" aria-label="Search">
<svg aria-hidden="true" focusable="false">…</svg>
</button>
Button(action: delete) { Image(systemName: "trash") }
.accessibilityLabel("Delete item")
.accessibilityHint("Permanently removes this item")
IconButton(onClick = onDelete) {
Icon(Icons.Default.Delete, contentDescription = "Delete item")
}
Note what is not here: no role="button" on the web (the element supplies it), no
.isButton trait on iOS (Button supplies it). Adding them is noise; adding them to a <div>
instead of using a <button> is the actual bug.
Anti-patterns
| Pattern | Why it fails | Instead |
|---|---|---|
<div onclick> | No focus, no Enter/Space, no role, no disabled state | <button>. If you truly can't: role="button", tabindex="0", and handlers for both Enter and Space |
| Colour as the only signal | Invisible to colour-blind users and in high-contrast modes | Colour plus text, an icon, or a border change |
| Modal that doesn't trap focus | Keyboard users tab into the page behind it | Contain focus while open, restore it to the trigger on close, and always allow Escape (SC 2.1.2) |
alt="Image of a chart" | Screen readers already announce the role | Describe the content: alt="Sales rose 40% in Q3" |
outline: none with no replacement | Removes the only focus signal keyboard users have | Style :focus-visible deliberately, at 3:1 contrast |
aria-label on a non-interactive <div> | Frequently not announced at all | Put the label on something with a role |
| Placeholder as the only label | Disappears on input; often fails contrast | A real <label>, visually hidden if the design demands |
Checklist
- Every interactive element is reachable and operable by keyboard alone
- Focus is always visible, and never fully hidden behind sticky UI
- Icon-only controls have a name; decorative graphics are hidden
- Targets meet the platform minimum (24 CSS px / 44 pt / 48 dp)
- No meaning carried by colour alone
- Text contrast 4.5:1, UI and focus indicators 3:1
- Modals trap focus, restore it on close, and close on Escape
- Errors say how to fix, and are announced not just coloured
- Login allows paste and password managers
- Layout works at 320 CSS px and 200% text scaling
- Dynamic updates announce via a live region
Rationalizations
| Excuse | Reality |
|---|---|
| "We'll do an accessibility pass later" | Retrofitting means rebuilding the controls. The native element costs nothing today |
| "Our users don't use screen readers" | Keyboard, zoom, and voice control users are the majority of the benefit, and you can't see them in analytics |
| "The designer specified this contrast" | Then the design fails and the design has to change. Say so with the ratio |
| "It's an internal tool" | Your colleagues have the same range of ability as your customers |
| "The library component isn't accessible" | Then it isn't done. Wrap it, patch it, or replace it |
Verifying
Automated tooling (axe, Lighthouse, Accessibility Scanner, Xcode Accessibility Inspector) catches roughly a third of issues — contrast, missing names, bad ARIA. It cannot tell you whether a name is meaningful or an order is sensible.
The manual pass that finds the rest: unplug the mouse and complete the task; then run the platform screen reader (VoiceOver, TalkBack, NVDA) and do it again with the screen off.
Non-goals
Doesn't do visual design or brand colour selection — it says which combinations fail. Doesn't cover AAA. Doesn't audit content quality, only its accessibility.
References
- WCAG 2.2 · Understanding docs
- ARIA Authoring Practices — patterns for custom controls
- Apple HIG: Accessibility
- Android accessibility
Source
Adapted from ECC by Affaan Mohamed (MIT).