Skip to the page

Accessibility in practice · mid

Accessibility in React and React Native

React uses the same HTML and ARIA (with htmlFor, useId for ids, refs for focus) plus lint rules and accessible component libraries, while React Native maps props like accessibilityLabel / aria-label, role, aria-* states and live regions to iOS VoiceOver and Android TalkBack.

The notes

What you must know

  • React: htmlFor instead of for; useId() for label/hint/error ids; refs + useEffect to move focus; fragments avoid wrapper divs that break lists/tables; eslint-plugin-jsx-a11y catches common mistakes.
  • Use headless accessible libraries (React Aria, Radix, Headless UI, Ariakit) for menus, comboboxes, date pickers; write your own only with the APG pattern and screen-reader testing.
  • React Native: Touchables are accessible by default; give icon buttons accessibilityLabel (or aria-label); role (newer, preferred) or accessibilityRole; accessibilityHint for extra context.
  • RN states: accessibilityState or aria-checked / aria-disabled / aria-expanded / aria-selected / aria-busy; values with accessibilityValue / aria-valuenow etc.
  • RN announcements: accessibilityLiveRegion / aria-live (Android), AccessibilityInfo.announceForAccessibility; isScreenReaderEnabled(); modal content with accessibilityViewIsModal / aria-modal (iOS); importantForAccessibility='no-hide-descendants' (Android) to hide background views.
  • RN also: support font scaling (don't disable allowFontScaling), touch targets about 44pt/48dp (hitSlop), group related text into one accessible element, test with TalkBack and VoiceOver on devices.

The red pen

Common traps: mistake → fix

  • Mistake: "RN aria-live works the same on iOS"

    Fix: accessibilityLiveRegion is Android-only; on iOS use AccessibilityInfo.announceForAccessibility.

  • Mistake: "Disable font scaling to protect the layout"

    Fix: users who need large text can't read the app; design layouts that grow.

  • Mistake: "jsx-a11y passing means the component is accessible"

    Fix: lint catches static mistakes, not keyboard flow or announcements.

Easy to hard

Questions interviewers ask, easy to hard

  1. How do you make a React component accessible? What tools help?
  2. What makes a React Native screen accessible? How do you test it with TalkBack and VoiceOver?
  3. How do you announce 'Added to cart' in React and in React Native?

Practise

Practise with these questions

Explain it out loud

Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.

Practise by voice

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview