Skip to main content

Getting Started

Installation

npm install react-international-phone

Basic usage

import { useState } from 'react';
import { PhoneInput } from 'react-international-phone';
import 'react-international-phone/style.css';

const App = () => {
const [phone, setPhone] = useState('');

return (
<div>
<PhoneInput
defaultCountry="ua"
value={phone}
onChange={(phone) => setPhone(phone)}
/>
</div>
);
};
note

Don't forget to import default styles when using UI components

import 'react-international-phone/style.css';