react-phone-simple
v1.0.22
Published
Simple react phone number component without any validation
Downloads
6
Readme
react-phone-simple 📞
Simple and lightweight React component for phone numbers with phone code.
Demo here: https://diazweb.github.io/react-phone-simple/
How it works?
Install the package:
npm i react-phone-simple
Import the component:
import ReactPhoneSimple from "react-phone-simple";
Insert the component in your code:
<ReactPhoneSimple
handleChange={phone => this.props.setPhone(phone)}
defaultPhoneCode={"us"}
/>
Props:
| props | required | description | |------------------|----------|--------------------------------------------------| | handleChange | yes | Function to get the returned phone and phoneCode | | defaultPhoneCode | yes | For example: US, ES, DE ... | | defaultPhone | no | If you want to set an existing phone | | placeholder | no | Placeholder of the input | | required | no | Set required attribute |