ern-phone-input
v0.1.2
Published
<div> <b>ern-phone-input</b> <p>stands out as a user-friendly input field for phone numbers, seamlessly predicting the country and formatting the entered phone number accordingly by default.For international phone numbers, users can effortlessly choos
Downloads
3
Readme
ern-phone-input
Installation
npm:
npm i ern-phone-input
yarn:
yarn add ern-phone-input
Props:
In addition to the here listed Props you can pass all other properties that can be used on a normal Html input field
Code example:
import React, { useState } from 'react'
import { PhoneInput, PhoneNumber } from 'react-phonenr-input';
const Example = () => {
const [value, setValue] = useState<PhoneNumber>('')
const handleChange = (phoneNumber: PhoneNumber) => {
// Do something with the phoneNumber
setValue(phoneNumber)
}
return (
<div>
<PhoneInput onChange={handleChange}/>
</div>
)
}
Support
If you like the project and want to support me, you can buy me a coffee :)