Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

mo-othman/react-int-phone-input

Repository files navigation

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'

About

React international phone number input component

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /