4.2.9 ā€¢ Published 9 days ago

react-international-phone v4.2.9

Weekly downloads
-
License
MIT
Repository
github
Last release
9 days ago

react-international-phone

šŸ¤™ International phone input component for React

npm-version build-status-badge install-size-badge codecov downloads Semantic Release stars

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

Documentation

Find the full API reference on official documentation.

Migration

You can encounter some breaking changes after update between major versions.

Checkout migration documents that contain a list of breaking changes and ways to migrate: Update from v3 to v4 Update from v2 to v3 Update from v1 to v2

4.2.9

9 days ago

4.2.8

19 days ago

4.2.7

24 days ago

4.2.6

3 months ago

4.2.5

3 months ago

4.2.3

3 months ago

4.2.4

3 months ago

4.2.2

3 months ago

4.2.1

4 months ago

4.2.0

4 months ago

4.1.0

4 months ago

4.0.4

6 months ago

4.0.1

6 months ago

4.0.0

7 months ago

4.0.3

6 months ago

4.0.2

6 months ago

2.3.0

10 months ago

2.3.2

10 months ago

2.2.3

10 months ago

2.3.1

10 months ago

2.3.3

9 months ago

3.1.2

9 months ago

3.1.1

9 months ago

3.0.2

9 months ago

3.1.0

9 months ago

3.0.1

9 months ago

3.0.0

9 months ago

4.0.0-canary.2

8 months ago

4.0.0-canary.1

8 months ago

1.8.2

1 year ago

1.6.4

1 year ago

1.8.1

1 year ago

1.6.3

1 year ago

1.8.0

1 year ago

1.7.0

1 year ago

2.2.1

1 year ago

2.0.3

1 year ago

2.2.0

1 year ago

2.0.2

1 year ago

2.2.2

1 year ago

2.0.4

1 year ago

2.1.0

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.8.8

1 year ago

1.8.7

1 year ago

1.8.6

1 year ago

1.8.5

1 year ago

1.8.4

1 year ago

1.8.3

1 year ago

1.6.5

1 year ago

1.6.2

1 year ago

1.6.1

1 year ago

1.6.0

1 year ago

1.5.2

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago