Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 921 Bytes

has-valid-accessibility-traits.md

File metadata and controls

45 lines (33 loc) · 921 Bytes

has-valid-accessibility-traits

Note: accessibilityTraits will soon be deprecated. When possible, use accessibilityRole and accessibilityStates instead of accessibilityTraits and accessibilityComponentType.

The accessibilityTraits property is used to tell a person using VoiceOver what kind of element they have selected.

Values may be one of the following

  • none
  • button
  • link
  • header
  • search
  • image
  • selected
  • plays
  • key
  • text
  • summary
  • disabled
  • frequentUpdates
  • startsMedia
  • adjustable
  • allowsDirectInteraction
  • pageTurn

References

  1. React Native Docs - AccessibilityTraits - iOS

Rule details

This rule takes no arguments.

Succeed

<TouchableOpacity accessibilityTraits="button" />

Fail

<TouchableOpacity accessibilityTraits="primary-button" />