2.4.10 • Published 2 years ago

@jansedlon/material-ui-phone-input v2.4.10

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

material-ui-phone-number

Highly customizable phone input component with auto formatting. Based on the wonderful material-ui-phone-number that is based on wonderful react-phone-input-2 package.

It looks like this, but in Material Design:

alt tag

Uses @material-ui/core/TextField for rendering the phone input

Installation

npm install @jansedlon/material-ui-phone-input --save

Usage

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

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 handleOnChange(value) {
   this.setState({
      phone: value
   });
}

Options

Regions

Regions selected: {'europe'}

<MuiPhoneInput
  defaultCountry='it'
  regions={'europe'}
/>

Regions selected: {'north-america', 'carribean'}

<MuiPhoneInput
  defaultCountry='ca'
  regions={['north-america', 'carribean']}
/>

Localization

<MuiPhoneInput
  onlyCountries=['de', 'es']
  localization={{'Germany': 'Deutschland', 'Spain': 'España'}}
/>

Supported events

Country data object not returns from onKeyDown event

License

Base on material-ui-phone-number

Based on react-phone-input-2

Based on react-phone-input using MIT

2.4.9

2 years ago

2.4.10

2 years ago

2.4.8

3 years ago

2.4.7

3 years ago

2.4.6

3 years ago

2.4.3

3 years ago

2.4.5

3 years ago

2.4.4

3 years ago

2.4.2

3 years ago

2.4.1

3 years ago

2.4.0

3 years ago

2.3.0-alpha6

3 years ago

2.3.0-alpha4

3 years ago

2.3.0-alpha5

3 years ago

2.3.0-alpha2

3 years ago

2.3.0-alpha3

3 years ago

2.2.9

3 years ago

2.2.8

3 years ago

2.3.0-alpha1

3 years ago

2.2.7

3 years ago