Accessibility

From affaan-m/everything-claude-code · View interactive version

Accessibility is an AI agent skill from the GitHub repository affaan-m/everything-claude-code. Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels, accessibility traits and hints, focus management, contrast, target size, and screen-reader support. Use when building or auditing UI for accessibility compliance, keyboard n

How to use this skill

Skill file

Accessibility (WCAG 2.2)

This skill ensures that digital interfaces are Perceivable, Operable, Understandable, and Robust (POUR) for all users, including those using screen readers, switch controls, or keyboard navigation. It focuses on the technical implementation of WCAG 2.2 success criteria.

When to Use

Core Concepts

How It Works

Step 1: Identify the Component Role

Determine the functional purpose (e.g., Is this a button, a link, or a tab?). Use the most semantic native element available before resorting to custom roles.

Step 2: Define Perceivable Attributes

Step 3: Implement Operable Controls

Step 4: Ensure Understandable Logic

Step 5: Verify Robust Compatibility

Accessibility Architecture Diagram

flowchart TD
  UI["UI Component"] --> Platform{Platform?}
  Platform -->|Web| ARIA["WAI-ARIA + HTML5"]
  Platform -->|iOS| SwiftUI["Accessibility Traits + Labels"]
  Platform -->|Android| Compose["Semantics + ContentDesc"]

  ARIA --> AT["Assistive Technology (Screen Readers, Switches)"]
  SwiftUI --> AT
  Compose --> AT

Cross-Platform Mapping

| Feature | Web (HTML/ARIA) | iOS (SwiftUI) | Android (Compose) |

| :----------------- | :----------------------- | :----------------------------------- | :---------------------------------------------------------- |

| Primary Label | aria-label / <label> | .accessibilityLabel() | contentDescription |

| Secondary Hint | aria-describedby | .accessibilityHint() | Modifier.semantics { stateDescription = ... } |

| Action Role | role="button" | .accessibilityAddTraits(.isButton) | Modifier.semantics { role = Role.Button } |

| Live Updates | aria-live="polite" | AccessibilityNotification.Announcement(...).post() (iOS 17+, .low priority) | Modifier.semantics { liveRegion = LiveRegionMode.Polite } |

Examples

Web: Accessible Search

<form role="search">
  <label for="search-input" class="sr-only">Search products</label>
  <input type="search" id="search-input" placeholder="Search..." />
  <button type="submit" aria-label="Submit Search">
    <svg aria-hidden="true">...</svg>
  </button>
</form>

iOS: Accessible Action Button

Button(action: deleteItem) {
    Image(systemName: "trash")
}
.accessibilityLabel("Delete item")
.accessibilityHint("Permanently removes this item from your list")
.accessibilityAddTraits(.isButton)

iOS 17+: Announce a Status Update

Keep the status visible in the UI. After a save succeeds, post one low-priority announcement from the completion handler so VoiceOver can read it after its current speech without moving focus.

import Accessibility
import Foundation

@available(iOS 17.0, *)
func announceSaveCompleted() {
    var message = AttributedString("Changes saved.")
    message.accessibilitySpeechAnnouncementPriority = .low
    AccessibilityNotification.Announcement(message).post()
}

Android: Accessible Toggle

Switch(
    checked = isEnabled,
    onCheckedChange = { onToggle() },
    modifier = Modifier.semantics {
        contentDescription = "Enable notifications"
    }
)

Anti-Patterns to Avoid

Best Practices Checklist

References

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.