Keyboard focus for interactive elements
The keyboard focus for interactive elements rule ensures all interactive elements in your app are reachable and operable using an external keyboard. This ensures that users who rely on a keyboard for navigation can access every feature without needing to use touch or mouse input.
- Rule Category:
Focus and Navigation - WCAG 2.1 & 2.2 SC:
2.1.1 (A),2.1.3 (AAA) - Rule Severity:
Critical - Supported Platforms and Frameworks:
Android,iOS,React Native,Flutter
Success criteria
The specific criterion for success is:
- Every interactive element is reachable and operable using an external keyboard.
How to fix
To ensure keyboard operability for assistive technology users, follow these steps:
- Use native controls, such as
Button,EditText,CheckBox,Switch, etc. These controls are focusable by default. - For custom controls, set the following attributes to manually define focus behavior:
android:focusable="true"android:focusableInTouchMode="true"android:importantForAccessibility="yes"
- Ensure focus can move logically between elements and is not blocked or trapped.
- Use standard UIKit or SwiftUI controls, such as
UIButton,UITextField,UISwitch, etc. These controls are focusable by default. - For custom controls:
- Ensure the element is accessible by setting
isAccessibilityElement = YES. - Expose proper accessibility traits, such as
.button,.adjustable, etc.
- Ensure the element is accessible by setting
- Support keyboard activation by handling:
-
UIKeyCommandin UIKit. - Keyboard shortcuts or focus activation in SwiftUI.
-
- Ensure focus can move logically between elements and is not blocked or trapped.
Although isAccessibilityElement = YES ensures screen reader access, it does not guarantee keyboard operability. You must explicitly support keyboard focus and activation for custom controls.
- Use accessible components, such as
Pressable,TouchableOpacity,Button, instead of plainView. - Set
accessible={true} - Set the correct
accessibilityRole. For example,button,checkbox,link. - Support keyboard interaction by handling
onKeyPressfor Enter or Space where needed.
- Use built-in widgets, such as
ElevatedButton,TextField,Switch, etc. These widgets are focusable by default. - For custom widgets:
- Wrap them in
FocusorFocusableActionDetector. - Ensure actions are mapped to keyboard inputs. For example,
ActivateIntent.
- Wrap them in
Example
The following Android example scan report highlights a keyboard focus for interactive elements violation for a button that is marked as important for accessibility but is not focusable.

Error
- The button has the
android:importantForAccessibilityattribute set toyes, but theandroid:focusableattribute is set tofalse. As a result, the button is not reachable via keyboard navigation.
Fix
To fix this violation:
- Set the
android:focusableattribute totruefor the button in your layout XML file to make it focusable via keyboard navigation.
The following iOS example scan report highlights a keyboard focus for interactive elements violation for a button that is marked as an accessibility element but does not respond to user interaction.

Error
- The button has the
isAccessibilityElementproperty set to1, ortrue, but theaccessibilityRespondsToUserInteractionproperty is set to0, orfalse. As a result, the button is not reachable via keyboard navigation.
Fix
To fix this violation:
- Set the
accessibilityRespondsToUserInteractionproperty totruefor the button to make it focusable via keyboard navigation.
References
- 2.1.1 Keyboard (Level A) - WCAG 2.1 · WCAG 2.2
- 2.1.3 Keyboard (No Exception) (Level AAA) - WCAG 2.1 · WCAG 2.2
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!