accessibility-react-native
Skill9 starsChanged 8 months agoMITView on GitHub
Implement, audit, and fix accessibility (a11y) in React Native and Expo mobile apps.
- Installs packages
In this repository31 other files it gives its agents.
- git-workflow-releaseSkill
- skill-authoring-generalSkill
- git-workflow-releaseSkill
- skill-authoring-generalSkill
- accessibility-generalSkill
- architecture-generalSkill
- architecture-pythonSkill
- assistant-rocky-lti-assistSkill
- assistant-ucd-mobileSkill
- ci-cd-github-actionsSkill
- code-review-generalSkill
- code-review-pythonSkill
- code-review-typescriptSkill
- data-science-pythonSkill
- design-frontendSkill
- documentation-projectSkill
- documentation-readmeSkill
- git-workflow-generalSkill
- git-workflow-monorepoSkill
- git-workflow-pr-generatorSkill
- git-workflow-releaseSkill
- infrastructure-terraformSkill
- package-management-pythonSkill
- project-management-jiraSkill
- refactoring-typescriptSkill
- security-generalSkill
- skill-authoring-generalSkill
- testing-generalSkill
- testing-javaSkill
- testing-pythonSkill
- testing-typescriptSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Use this skill for:
- Distinctive: line 62
Run the audit script to surface issues before writing any code:
- Very specific: line 94
Run the contrast check: node scripts/contrast-check.js
- Very specific: line 116
Write accessibility-focused unit tests — see references/testing.md.
- Distinctive: line 139
Use this checklist per screen.
- Distinctive: line 183
Managed Workflow: All standard RN a11y props work.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
React Native / Expo Accessibility Skill
This skill implements and audits accessibility (a11y) in React Native and Expo apps, following WCAG 2.1 AA standards as adapted for mobile (iOS VoiceOver + Android TalkBack).
When This Skill Is Needed
Use this skill for:
- Implementing
accessibilityLabel,accessibilityHint,accessibilityRole,accessibilityState,accessibilityValue - Auditing a component, screen, or entire app for a11y gaps
- Fixing VoiceOver / TalkBack focus order and grouping
- Checking color contrast and tap target sizes
- Writing accessible custom components (modals, carousels, date pickers, etc.)
- Integrating automated a11y testing (eslint-plugin-jsx-a11y adapted for RN, react-native-a11y)
- Adding
AccessibilityInfoAPI usage (reduce motion, screen reader detection)
Core Principles
- Every interactive element must have an accessible name — via
accessibilityLabelor meaningful text child. - Every interactive element must have a role —
accessibilityRoletells screen readers what it is. - State must be announced — use
accessibilityStatefordisabled,selected,checked,expanded,busy. - Logical reading order — use
importantForAccessibility(Android) andaccessibilityViewIsModalto manage focus scope. - Tap targets ≥ 44×44 pts — per Apple HIG and Android guidelines.
- 4.5:1 contrast ratio — for normal text; 3:1 for large text and UI components.
- No information conveyed by color alone — always pair with text, icon, or pattern.
- Support Reduce Motion — gate animations behind
AccessibilityInfo.isReduceMotionEnabled().
Quick Reference: Core A11y Props
| Prop | Platform | Purpose |
accessible | Both | Groups children into one focusable node |
accessibilityLabel | Both | Name read aloud by screen reader |
accessibilityHint | Both | Explains the result of an action |
accessibilityRole | Both | Semantic role (button, link, header, image, etc.) |
accessibilityState | Both | {disabled, selected, checked, expanded, busy} |
accessibilityValue | Both | {min, max, now, text} for sliders/progress |
accessibilityLiveRegion | Android | 'none', 'polite', 'assertive' for dynamic content |
aria-live | Both (RN ≥0.73) | ARIA-aligned live region |
accessibilityViewIsModal | iOS | Traps focus inside modal |
importantForAccessibility | Android | 'yes', 'no', 'no-hide-descendants' |
onAccessibilityAction | Both | Custom actions for screen readers |
accessibilityActions | Both | Declares custom action names |
For detailed prop usage with examples, see references/props.md.
Implementation Workflow
Step 1 — Audit (find gaps)
Run the audit script to surface issues before writing any code:
node scripts/audit.js <path-to-src>This checks for:
- Touchable/Pressable elements missing
accessibilityLabeloraccessibilityRole - Images missing
accessibilityLabeloraccessibilityIgnoresInvertColors TextInputmissingaccessibilityLabel(separate fromplaceholder)- Custom interactive components lacking roles
- Potential color-only information (flag for manual review)
Then do a manual walkthrough with:
- iOS Simulator → Accessibility Inspector (
Xcode > Open Developer Tool > Accessibility Inspector) - Android Emulator → TalkBack (Settings > Accessibility > TalkBack)
Step 2 — Fix by component type
See references/components.md for canonical patterns for:
- Buttons & Pressables
- Text Inputs & Forms
- Images & Icons
- Lists & FlatList
- Navigation (Tab bars, Stack headers)
- Modals & Bottom Sheets
- Custom controls (Switch, Slider, Checkbox, Radio)
- Loading / Skeleton states
Step 3 — Verify color contrast
- Extract all color pairs (text + background) from your design tokens / StyleSheet.
- Run the contrast check:
node scripts/contrast-check.js - Fix any failures — see
references/contrast.mdfor replacement palette strategies.
Step 4 — Add automated testing
Install and configure:
npx expo install @testing-library/react-native
npm install --save-dev eslint-plugin-jsx-a11yAdd to .eslintrc:
{
"plugins": ["jsx-a11y"],
"extends": ["plugin:jsx-a11y/recommended"],
"rules": {
"jsx-a11y/interactive-supports-focus": "error"
}
}Write accessibility-focused unit tests — see references/testing.md.
Step 5 — Reduce Motion & Dynamic Type
import { AccessibilityInfo } from 'react-native';
// Reduce Motion
const [reduceMotion, setReduceMotion] = useState(false);
useEffect(() => {
AccessibilityInfo.isReduceMotionEnabled().then(setReduceMotion);
const sub = AccessibilityInfo.addEventListener('reduceMotionChanged', setReduceMotion);
return () => sub.remove();
}, []);
// Dynamic Type (iOS) — use allowFontScaling (default true, do NOT set false)
<Text allowFontScaling={true} maxFontSizeMultiplier={2}>...</Text>Audit Checklist
Use this checklist per screen. Check each item; document failures with component name + line number.
Perceivable
- All images have
accessibilityLabelor are marked decorative (accessible={false}) - Color is not the only means of conveying information
- Text contrast ≥ 4.5:1 (normal) / 3:1 (large ≥18pt or bold ≥14pt)
- UI component contrast ≥ 3:1 against adjacent colors
allowFontScalingis NOT disabled on anyTextorTextInput
Operable
- All interactive elements have
accessibilityRole - All interactive elements have
accessibilityLabel(or unambiguous text child) - Tap targets ≥ 44×44 pts (use
hitSlopto extend without changing layout) - Focus order matches reading/visual order
- No time limits without accessible pause/extend mechanism
- Animations respect Reduce Motion setting
Understandable
- Form inputs have visible labels (not just placeholder)
- Error messages are programmatically associated with inputs
accessibilityHintused where action outcome isn't obviousaccessibilityLiveRegion/aria-liveon dynamic content (toasts, errors, countdowns)
Robust
- Custom interactive components announce state changes
- Modal/overlay traps focus (
accessibilityViewIsModal={true}on iOS) - Keyboard/switch access works (external keyboard, switch control)
- No a11y props on decorative non-interactive
Views (reduces noise)
Common Mistakes to Avoid
- ❌
accessibilityLabelon aViewwrapping aTouchableOpacity(set it on the Touchable itself) - ❌ Using
placeholderas the only label forTextInput(VoiceOver reads placeholder as label, but it disappears on input) - ❌
accessible={false}on a container that has interactive children (hides them from screen reader) - ❌ Hardcoded colors that ignore dark mode / high-contrast mode
- ❌ Calling
AccessibilityInfo.announceForAccessibilityon every render (debounce or trigger only on meaningful changes) - ❌ Setting
importantForAccessibility="no-hide-descendants"on a visible interactive group
Expo-Specific Notes
- Managed Workflow: All standard RN a11y props work. No native module needed.
- expo-router: Navigation screen titles are announced automatically. Supplement with
Stack.Screen options={{ title }}for clarity. - expo-image: Supports
accessibilityLabelprop directly; userole="presentation"for decorative images. - expo-av / expo-video: Provide captions/subtitles via
subtitleStylesandtracksprops. Announce play/pause state viaaccessibilityState={{ busy: isLoading }}. - Expo Go: Accessibility Inspector works with Expo Go on physical devices.
Reference Files
| File | Contents |
references/props.md | Full prop API reference with before/after code examples |
references/components.md | Canonical accessible patterns for 15+ component types |
references/contrast.md | WCAG contrast ratios, formulas, palette fix strategies |
references/testing.md | Unit test patterns, e2e with Detox, CI integration |
Scripts
| Script | Purpose |
scripts/audit.js | Static AST scan for missing a11y props |
scripts/contrast-check.js | Extract and validate color contrast from JS/TS files |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

