Socket
Socket
Sign inDemoInstall

@ambiot/material-ui-phone-field

Package Overview
Dependencies
42
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

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


Version published
Maintainers
1
Install size
7.91 MB
Created

Readme

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: npm install
  4. Run TSDX watcher using npm start
  5. Open another terminal and get inside the example folder: cd example
  6. Install all dependencies needed to launch the example: npm install
  7. Run npm start to launch the example app
  8. Library is located in src. Edit the code and watch the changes in the browser

FAQs

Last updated on 07 Dec 2021

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