react-phone-simple

1.0.22 • Public • Published

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

License

MIT

/react-phone-simple/

    Package Sidebar

    Install

    npm i react-phone-simple

    Weekly Downloads

    0

    Version

    1.0.22

    License

    MIT

    Unpacked Size

    139 kB

    Total Files

    20

    Last publish

    Collaborators

    • diazweb