React Native Phone Number Input
Performance oriented React Native Phone Number Input with typings and proper validation for any country.
Installation
OR
Features
- :iphone: Works with iOS and Android, Cross-platform :100:
- :crossed_flags: Built-in country picker (uses [react-native-country-picker-modal][react-native-country-picker-modal])
- :wrench: Completely customizable UI!
- :heavy_check_mark: Proper validation (uses google-libphonenumber)
Usage
For more complete example open App.tsx
Props
defaultCode?
: CountryCodewithDarkTheme?
: booleanwithShadow?
: booleanautoFocus?
: booleandefaultValue?
: stringdisabled?
: booleandisableArrowIcon?
: booleanonChangeText?
: (text: string) => void;onChangeFormattedText?
: (text: string) => void;containerStyle?
:StyleProp<ViewStyle>
;textInputProps?
: TextInputProps;textInputStyle?
:StyleProp<TextStyle>
;codeTextStyle?
:StyleProp<TextStyle>
;flagButtonStyle?
:StyleProp<ViewStyle>
;
Methods
getCountryCode
: () => CountryCodegetCallingCode
: () => string | undefinedisValidNumber
: () => boolean
FAQ
Is it supported and tested both on android and iOS?
YES
NSURLResponse allHeaderFields: unrecognized selector sent to instance XX crash?
Upgrade versions['Flipper'] ||= '~> 0.37.0'
in podfile.
Contributing
To get started...
Step 1
-
Option 1
- ? Fork this repo!
-
Option 2
- ? Clone this repo to your local machine using
https://github.com/garganurag893/react-native-phone-number-input
- ? Clone this repo to your local machine using
Step 2
- HACK AWAY! ???
Step 3
- ? Create a new pull request using
https://github.com/garganurag893/react-native-phone-number-input
.