Accessibility guide for Capacitor apps covering screen readers, semantic HTML, focus management, and WCAG compliance. Use this skill when users need to make their app accessible.
npx playbooks add skill cap-go/capacitor-skills --skill capacitor-accessibility
The UI is web content inside WKWebView / Android WebView, so standard semantic HTML and ARIA do most of the work. This skill covers where the WebView and native layers behave differently from a browser.
TRIGGER when:
@capacitor/screen-reader or @capacitor/text-zoom.Do not use:
ionic-design; Konsta/Tailwind -> konsta-ui, tailwind-capacitor.safe-area-handling.capacitor-keyboard.capacitor-testing.Use a user-selected test device and local web build. Prefer the project-installed axe dependency. Installing or running an npm tool downloads executable code; do so only as part of the requested audit, and preserve the lockfile. Restore device settings after testing.
@axe-core/playwright in tests, or npx @axe-core/cli@latest http://localhost:5173) and fix violations first (names, roles, contrast, labels).references/testing.md.px/rem text at fixed size regardless of Settings > Accessibility > Larger Text. Options:html { font: -apple-system-body; } and size everything else in rem/em (WebKit maps this to the user's content size category; updates live).TextZoom.getPreferred() then TextZoom.set({ value }) from @capacitor/text-zoom on launch and on resume. On iPad this requires ios.preferredContentMode: 'mobile' in capacitor.config.*.Pick one, not both, or text scales twice.
line-clamp, and absolute layouts overflow at 200%. Test with adb shell settings put system font_scale 2.0 and design for reflow (WCAG 1.4.4, 1.4.10).zoomEnabled defaults to false and many templates ship user-scalable=no. Users can still scale text via traps 1/2; if you rely on zoom instead, set zoomEnabled: true and drop user-scalable=no.document.title, move focus to the main heading (<h1 tabindex="-1">), or update a polite live region. Do not use ScreenReader.speak as the primary mechanism: it only speaks when a screen reader is active and bypasses the user's verbosity settings.@capacitor/google-maps renders a native map behind a transparent WebView region; camera preview plugins do the same. The screen reader sees the WebView, not the native view. Provide an accessible alternative (list of markers, text summary, capture button with label) in HTML.accessibilityLabel/contentDescription (see references/native.md).prefers-reduced-motion and prefers-contrast media queries work in both WebViews. Disable parallax/auto-playing transitions under reduce motion; test Increase Contrast.@capacitor/toast is native and announced), inline errors, spinners: use role="status" / aria-live="polite" for web toasts and aria-busy on loading regions; use role="alert" only for errors.<body>. Restore focus to the triggering control on appStateChange/promise resolution.xcrun simctl ui booted content_size accessibility-extra-extra-extra-large and adb shell settings put system font_scale 2.0; no clipped or overlapping text, no horizontal scroll on body.grep -rnE "user-scalable=no|maximum-scale=1" index.html src/ and grep -rn "outline: none\|outline: 0" src/ (each must have a :focus-visible replacement).adb shell settings put system font_scale 1.0, xcrun simctl ui booted content_size large.| Symptom / message | Fix |
|---|---|
| ScreenReader.isEnabled rejects/unavailable on web | Not supported on web (screen readers cannot be detected); guard with Capacitor.isNativePlatform(). |
| speak throws on web | Browser lacks SpeechSynthesis; only call on native or feature-detect 'speechSynthesis' in window. |
| "TextZoom" plugin is not implemented on web | text-zoom is native only; skip on web. |
| Text zoom has no effect on iPad | Set ios.preferredContentMode: 'mobile'. |
| Text scaled twice on iOS | Using both -apple-system-body and TextZoom; keep one. |
| VoiceOver reads "button" with no name | Icon-only control missing aria-label or visible text. |
Only load when the topic is in play:
references/testing.md: VoiceOver/TalkBack gestures, Accessibility Inspector, Android Accessibility Scanner, adb/simctl setting commands, axe in Playwright, per-screen checklist.references/native.md: Swift/Kotlin accessibility APIs for custom native plugin views, posting announcements from native code.Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.