Note: accessibilityRole
and accessibilityStates
are meant to be a cross-platform solution to replace accessibilityTraits
and accessibilityComponentType
, which will soon be deprecated. When possible, use accessibilityRole
and accessibilityStates
instead of accessibilityTraits
and accessibilityComponentType
.
The accessibilityStates property is used to tell Talkback or Voiceover the state a UI Element is in.
"selected"
: Used when the element is in a selected state. For example, a button is selected."disabled"
: Used when the element is disabled and cannot be interacted with
This rule takes no arguments.
<TouchableOpacity accessibilityStates={["selected"]} />
<TouchableOpacity accessibilityStates={["disabled"]} />
<TouchableOpacity accessibilityStates={["selected", "disabled"]} />
<TouchableOpacity accessibilityStates={[]} />
<TouchableOpacity accessibilityStates={[""]} />
<TouchableOpacity accessibilityStates="highlighted" />