react-int-phone-input

0.1.5 • Public • Published

React-Int-Phone-Input

A lightweight React international phone number input with taking UX in consideration Alt text

Live Demo

Demo

Installation

npm install react-int-phone-input --save

Usage

import React, {useState} from 'react';
import PhoneNumberInput from 'react-int-phone-input';

const App = () => {
    const [value, setValue] = useState();

    return (
        <PhoneInput
            value={value}
            onChange={setValue}
        />
    )
}

- Default country

You can set the default selected country by using defaultCountry

import React, {useState} from 'react';
import PhoneNumberInput from 'react-int-phone-input';

const App = () => {
    const [value, setValue] = useState();

    return (
        <PhoneInput
            value={value}
            onChange={setValue}
            defaultCountry={'GB'}
        />
    )
}

Props

Name Type Description Default Example
showCountryCode Boolean To render the country code in the UI true false
defaultCountry string initial country 'US' 'US'

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.50latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.50
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20

Package Sidebar

Install

npm i react-int-phone-input

Weekly Downloads

0

Version

0.1.5

License

ISC

Unpacked Size

151 kB

Total Files

5

Last publish

Collaborators

  • mo-othman