SwitchWrapper
The component provides built-in accessibility implementation for creating a custom switch.
Usage
import {SwitchWrapper} from 'react-native-ama';
<SwitchWrapper
accessibilityLabel={accessibilityLabel}
style={[allStyles.container, style]}
onPress={onValueChange}
checked={value}>
<CustomSwitcher checked={checked} onPress={onValueChanged}>
</SwitchWrapper>
Accessibility
The component uses the useSwitch hook under the hood and:
- Sets the accessibilityRole property to switch
- Handled the accessibilityState needed by the Screen Reader
- Performs a Minimum Size check
- Performs a check on the accessibilityLabel