Socket
Socket
Sign inDemoInstall

react-telephone

Package Overview
Dependencies
5
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-telephone

☎️ Tiniest react input phone component (auto formating included)


Version published
Weekly downloads
184
decreased by-12.38%
Maintainers
1
Install size
290 kB
Created
Weekly downloads
 

Readme

Source

react-telephone - Demo

All Contributors


☎️ react-telephone

Tiniest react input phone component (auto formating included)


Demo · Documentation · Twitter Created by Joris

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):

Joris
Joris

💻 📖 🤔 👀
Michaël Rézac
Michaël Rézac

🤔 💻
Varshneya Rao
Varshneya Rao

💻

Keywords

FAQs

Last updated on 14 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc