百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

react-native-phone-number-input

> 前端框架
开源

用于电话号码的 React Native 组件。

387 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

用于电话号码的 React Native 组件。

React Native Phone Number Input

Performance oriented React Native Phone Number Input with typings and proper validation for any country.

Made with ❤️ by developer for developers

Want to show your love?

Click on button.

Table of Contents

  • Table of Contents
  • Installation
  • Features
  • Usage
  • Props
  • Methods
  • FAQ
    • Is it supported and tested both on android and iOS?
    • NSURLResponse allHeaderFields: unrecognized selector sent to instance XX crash?
  • Contributing
    • Step 1
    • Step 2
    • Step 3
  • Support
  • License
  • Hire

Installation

bash
$ yarn add react-native-phone-number-input

OR

bash
$ npm i react-native-phone-number-input --save

Features

  • :iphone: Works with iOS and Android, Cross-platform :100:
  • :crossed_flags: Built-in country picker (uses 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?: CountryCode
  • withDarkTheme?: boolean
  • withShadow?: boolean
  • autoFocus?: boolean
  • defaultValue?: string
  • value?: string
  • disabled?: boolean
  • disableArrowIcon?: boolean
  • placeholder?: string;
  • onChangeCountry?: (country: Country) => void;
  • onChangeText?: (text: string) => void;
  • onChangeFormattedText?: (text: string) => void;
  • containerStyle?: StyleProp;
  • textContainerStyle?: StyleProp;
  • renderDropdownImage?: JSX.Element;
  • textInputProps?: TextInputProps;
  • textInputStyle?: StyleProp;
  • codeTextStyle?: StyleProp;
  • flagButtonStyle?: StyleProp;
  • countryPickerButtonStyle : StyleProp;
  • layout?: "first" | "second";
  • filterProps?: CountryFilterProps;
  • countryPickerProps?: any;

Methods

  • getCountryCode: () => CountryCode
  • getCallingCode: () => string | undefined
  • getNumberAfterPossiblyEliminatingZero: () => {number: string , formattedNumber: string };
  • isValidNumber: (number: string) => 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

Step 2

  • HACK AWAY!

Step 3

  • Create a new pull request using https://github.com/garganurag893/react-native-phone-number-input.

Support

Reach out to me at one of the following places!

  • Twitter at https://twitter.com/AnuragG94634191
  • Medium at https://medium.com/@garganurag893
  • Instagram at https://www.instagram.com/the_only_anurag/
  • Email at [email protected]

License

  • MIT license

Hire

Looking for a React/React-Native Freelance Expert? Email at [email protected]

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScriptphone-numberreactreact-nativereactjs

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架