0.0.5 • Published 8 months ago

react-telephone-gp-fork v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Features

  • 🌐 Follows the E.164 : The international public telecommunication numbering plan
  • 🎨 Easily Customizable
  • 🪶 Lightweight - less than 6kb
  • 📞 Native - it's just a HMTL input
  • 🔌 easily integration - it works without additional configuration (remix, react-hook-form)
  • Controlled mode: coming soon
  • Custom render for Phone.Country and Phone.Number: coming soon

Examples (Demo)

Installation

yarn add react-telephone

or

npm i react-telephone

Usage

import { Phone } from 'react-telephone';

export default function MyComponent() {
  return (
    <Phone>
      <Phone.Country />
      <Phone.Number />
    </Phone>
  );
}

Props

PropDescriptionDefaultValue
defaultCountryDefault country displayed for the country selectorFirst country (Afghanistan)Country ISO2 code (fr, us)

Utils

NameDescription
countriesList of all countries.
getCountryByIsoReturns the country object for a given ISO code.
applyMaskApply the mask to a given phone number.
splitPhoneNumberSplit a phone number into country code and number.
replaceDialCodeReplace the dial code of a phone number.

Contributors

Thanks goes to these wonderful people (emoji key):

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago

0.0.0

8 months ago