Text
Text is an extension of the React Native Text component, focused on accessibility.
import { Text } from 'react-native-ama';
<Text autofocus>I'm pressable</Text>;
Accessibility improvements
Compared to the default React Native component, this one performs the following checks at runtime:
- Missing accessibilityLabel when using
textTransform: uppercase
style - accessibilityLabel in all caps
- Performs a Minimum Size check when the component has the property
onPress
set
Minimum size
The component uses the onLayout prop to perform the minium size check.
Additional Props
autofocus
Allows the screen reader to autofocus the Text element when it is rendered.
Type | Default |
---|---|
boolean | undefined |
note
When autofocus
is set to true, AMA forces the accessibilityRole
to header