1.7.14 ā€¢ Published 1 year ago

npm-quality-score-test-1 v1.7.14

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-international-phone

šŸ¤™ International phone input component for React

npm-version build-status-badge install-size-badge codecov downloads

Live demo: Storybook

demo-gif

Features

  • šŸ˜Ž Easy to integrate - Just import and use, no need for the initial setup. Integrate with any UI library using a headless hook.
  • šŸ” Country guessing - Just start typing and the component will guess the country and format the phone. Country flags are rendered using Twemoji.
  • āœØ Lightweight - Low bundle size, no third-party dependencies.
  • šŸŒˆ Easy to customize - Customize styles and component behavior using props.
  • āŒØ Caret position handling - Typing in the middle of the input, selection and deletion feels naturally.
  • āœ”ļø Validation - Easily validate entered phone numbers using provided functions.

Installation

$ npm i 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
        initialCountry="ua"
        value={phone}
        onChange={(phone) => setPhone(phone)}
      />
    </div>
  );
};

Documentation

Find the full API reference on official documentation.

1.7.14

1 year ago

1.7.13

1 year ago

1.7.12

1 year ago

1.7.11

1 year ago

1.7.9

1 year ago

1.7.8

1 year ago

1.7.7

1 year ago

1.7.6

1 year ago

1.7.5

1 year ago

1.7.4

1 year ago