Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA standards. Use this skill to generate semantic ARIA for Web and accessibility traits for Web and Native platforms (iOS/Android).
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 26% | 0% |
| case-19 | ✓→✗ | ▼ Worse | 94% | 0% |
| case-15 | ✓→✓ | = Same ✓ | 71% | 0% |
| case-07 | ✓→✓ | = Same ✓ | 32% | 0% |
| case-14 | ✓→✓ | = Same ✓ | 140% | 0% |
本技能确保数字界面对于所有用户(包括使用屏幕阅读器、开关控制或键盘导航的用户)具有可感知性、可操作性、可理解性和健壮性(POUR)。它专注于 WCAG 2.2 成功标准的技术实现。
aria-label、accessibilityLabel 和 contentDescription 提供上下文。确定功能目的(例如,这是按钮、链接还是标签页?)。在诉诸自定义角色之前,优先使用最语义化的原生元素。
Name, Role, Value 模式。aria-live 或活动区域。mermaidflowchart 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
| 特性 | Web (HTML/ARIA) | iOS (SwiftUI) | Android (Compose) | | :--------------- | :----------------------- | :----------------------------------- | :---------------------------------------------------------- | | 主标签 | aria-label / <label> | .accessibilityLabel() | contentDescription | | 辅助提示 | aria-describedby | .accessibilityHint() | Modifier.semantics { stateDescription = ... } | | 操作角色 | role="button" | .accessibilityAddTraits(.isButton) | Modifier.semantics { role = Role.Button } | | 实时更新 | aria-live="polite" | .accessibilityLiveRegion(.polite) | Modifier.semantics { liveRegion = LiveRegionMode.Polite } |
html<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>
swiftButton(action: deleteItem) { Image(systemName: "trash") } .accessibilityLabel("Delete item") .accessibilityHint("Permanently removes this item from your list") .accessibilityAddTraits(.isButton)
kotlinSwitch( checked = isEnabled, onCheckedChange = { onToggle() }, modifier = Modifier.semantics { contentDescription = "Enable notifications" } )
<div> 或 <span> 处理点击事件,但未添加角色和键盘支持。Escape 键或显式关闭按钮退出(WCAG SC 2.1.2)。Escape 键或关闭按钮)。frontend-patternsdesign-systemliquid-glass-designswiftui-patternsOther measured skills in the registry, with their headline benchmark lift.