New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mui-phone-input

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mui-phone-input

A phone number input built using material-ui's TextField

  • 1.0.1
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

mui-phone-input

This is a simple wrapper around material-ui's <TextField> component. This wrapper handles the input as a phone number. It only allows numbers, and dashes are automatically inserted and removed while typing.

Here is what the input looks like while typing:

GIF of typing numbers into input

Install

npm i mui-phone-input
# or
yarn add mui-phone-input

Usage with React

All properties available to material-ui's <TextField> are available to <PhoneInput>.

Here is a minimal example of using the input:

import React from 'react';
import PhoneInput from 'mui-phone-input';

function App() {
  const [value, setValue] = React.useState('');
  return (
    <div>
      <PhoneInput onChange={setValue} />
      <p>Your phone number is {value}</p>
    </div>
  );
}

Notes:

  • 90% of the time, you won't need to use two-way data binding. This is due to the fact that this input formats everything for you.
  • However, two-way data binding is still available.

FAQs

Package last updated on 19 Jan 2019

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