Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ambiot/material-ui-phone-field

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ambiot/material-ui-phone-field

Simple React phone input field based on [Material-UI](https://material-ui.com/), [`i18n-iso-countries`](https://www.npmjs.com/package/i18n-iso-countries) and [`libphonenumber-js`](https://www.npmjs.com/package/libphonenumber-js). **Overall look and feel w

  • 0.1.1
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

Material-UI Phone Field

Simple React phone input field based on Material-UI, i18n-iso-countries and libphonenumber-js. Overall look and feel will change when we add country flags.

Installation

To install the component run this command:

npm i -S @ambiot/material-ui-phone-field

API

PhoneField (default export)

Prop NameTypeDefaultDescription
valuestringempty stringAccepts plain phone number, without any formatting. For example, +79031234567
onChange(value: string) => void, requiredCallback when user changes the input. Returns plain phone number without any formatting. If user didn't choose the country, returns just the value of the text field. If user did, returns text field value with plus sign and country calling code prepended.
defaultCountrystringnullISO country code to be selected by default
fullWidthbooleanfalseIf true, field will take 100% of the available width.
languagestringenLanguage in which country names are displayed. Currently supports only en and ru values for English and Russian language respectively.

To-Do

  • Correctly expose registerLocale method of i18n-iso-countries without increasing the bundle size, so user can required languages manually.
  • Add country flags to Select field from the flags folder. See this TSDX issue and this StackOverflow question.

Contributing

The package is built using TSDX. Refer to its documentation if you need some advanced stuff. Here's simple stuff:

  1. Clone the repository: git clone https://github.com/ambiot-llc/material-ui-phone-field.git
  2. Get inside the folder: cd material-ui-phone-field
  3. Install all the general dependencies: yarn install
  4. Run TSDX watcher using yarn start
  5. Open another terminal and get inside the example folder: cd example
  6. Install all dependencies needed to launch the example: yarn install
  7. Run yarn start to launch the example app
  8. Library is located in src. Edit the code and watch the changes in the browser

FAQs

Package last updated on 17 Mar 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc