rn-international-phone-number
v0.14.0
Published
International mobile phone input component with mask for React Native
Maintainers
Readme
📚 Full documentation: astroonauta.github.io/react-native-international-phone-number
International mobile phone input for React Native, Expo and React Native Web. Country dial code selector, flag picker, auto phone mask, validation, line-type detection, smart paste, and i18n for 33 languages.
Features
- 🌎 Phone Input Mask – Auto-formatting per selected country
- ✅ Validation – Optional
onValidationChangecallback - 📞 Line Type Detection – Tell
MOBILE,FIXED_LINE,TOLL_FREE,VOIPand more apart - 📋 Smart Paste – Paste an E.164 number and the country switches automatically
- 💡 Dynamic Placeholder – Country-aware example number as placeholder (
placeholderType="number") - 🪝 Headless Hook –
usePhoneInputexposes all state + setters for fully custom UIs - 📱 Cross-Platform – iOS, Android and Web
- 🧩 Integration – React Native CLI & Expo, functional & class components
- 🈶 i18n – 33 languages (ISO 639-1 / ISO 639-2)
- ♿ Accessibility – Screen reader friendly
Try it out
Installation
npm install rn-international-phone-number react-native-safe-area-context
npx pod-install iosFor Web (React Native CLI / Expo font setup) and full configuration, see the Installation guide.
Quick start
import React, {useState} from 'react';
import {View} from 'react-native';
import PhoneInput, {ICountry} from 'rn-international-phone-number';
export default function App() {
const [phone, setPhone] = useState('');
const [country, setCountry] = useState<ICountry | null>(null);
return (
<View style={{flex: 1, padding: 24}}>
<PhoneInput
value={phone}
onChangePhoneNumber={setPhone}
country={country}
onChangeCountry={setCountry}
/>
</View>
);
}Documentation
| Topic | Link |
| --- | --- |
| Installation | astroonauta.github.io/.../installation |
| Quick Start | astroonauta.github.io/.../quick-start |
| Props API (51 props) | astroonauta.github.io/.../api/props |
| Ref API | astroonauta.github.io/.../api/ref |
| usePhoneInput hook | astroonauta.github.io/.../api/hooks |
| Utility functions | astroonauta.github.io/.../api/utilities |
| Theming & styles | astroonauta.github.io/.../guides/theming |
| i18n (33 languages) | astroonauta.github.io/.../guides/i18n |
| Accessibility | astroonauta.github.io/.../guides/accessibility |
| Testing | astroonauta.github.io/.../guides/testing |
| React Hook Form / Formik / TanStack Form | astroonauta.github.io/.../examples |
Contributing
Fork the repo, fix or improve, and open a PR. See the Contributing guide.
