Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-phone-input

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-phone-input

A react component to format phone numbers

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
240
decreased by-21.57%
Maintainers
1
Weekly downloads
 
Created
Source

react-phone-input

A simple react component to format a phone number as the user types.

alt tag

Installation:

npm install react-phone-input --save

Usage:

React.render(
  <ReactPhoneInput defaultCountry={'us'} onChange{handleOnChange)/>,
  document.getElementById('content'));

Your handler for the onChange event should expect a string as parameter, where the value is that of the entered phone number. For example:

function handeOnChange(value) {
   this.setState({
      phone: value
   });
}

Options:

NameDescription
defaultCountrycountry code to initialize the component
excludeCountriesarray of country codes to be excluded e.g. ['cu','cw','kz']
onlyCountriesarray of country codes to be included e.g. ['cu','cw','kz']
preferredCountriesarray of country codes to be preferred (highlighted at the top) e.g. ['cu','cw','kz']

License

MIT

Keywords

FAQs

Package last updated on 28 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc