Gathering detailed insights and metrics for my-mui-tel-input
Gathering detailed insights and metrics for my-mui-tel-input
Gathering detailed insights and metrics for my-mui-tel-input
Gathering detailed insights and metrics for my-mui-tel-input
📌 A phone number input designed for MUI (Material ui) built with libphonenumber-js
npm install my-mui-tel-input
Typescript
Module System
Node Version
NPM Version
58.5
Supply Chain
89.5
Quality
74.1
Maintenance
100
Vulnerability
99.3
License
TypeScript (98.99%)
JavaScript (0.79%)
HTML (0.22%)
Total Downloads
582
Last Day
1
Last Week
1
Last Month
10
Last Year
141
MIT License
191 Stars
250 Commits
77 Forks
2 Watchers
3 Branches
19 Contributors
Updated on Jun 15, 2025
Minified
Minified + Gzipped
Latest Version
1.3.3
Package Id
my-mui-tel-input@1.3.3
Unpacked Size
872.99 kB
Size
222.40 kB
File Count
21
NPM Version
8.11.0
Node Version
16.15.0
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
0%
1
Compared to previous week
Last Month
-41.2%
10
Compared to previous month
Last Year
46.9%
141
Compared to previous year
5
30
A phone number input designed for the React library MUI
// with npm
npm install mui-tel-input
// with yarn
yarn add mui-tel-input
1import React from 'react' 2import { MuiTelInput } from 'mui-tel-input' 3 4const MyComponent = () => { 5 const [value, setValue] = React.useState('') 6 7 const handleChange = (newValue) => { 8 setValue(newValue) 9 } 10 11 return <MuiTelInput value={value} onChange={handleChange} /> 12}
1import React from 'react' 2import Box from '@mui/material/Box' 3import Typography from '@mui/material/Typography' 4import { MuiTelInput, isValidPhoneNumber } from 'mui-tel-input' 5 6const MyComponent = () => { 7 const [value, setValue] = React.useState('') 8 const [isValid, setIsValid] = React.useState(false) 9 10 const handleChange = (newValue) => { 11 setIsValid(isValidPhoneNumber(newValue)) 12 setValue(newValue) 13 } 14 15 return ( 16 <Box> 17 <Typography>This is valid ? {isValid ? 'yes' : 'no'}</Typography> 18 <MuiTelInput value={value} onChange={handleChange} /> 19 </Box> 20 ) 21}
Name | Type | Description |
---|---|---|
value | string | The phone number value (Required) |
onChange? | (value, info) => void | Gets called once the user updates the input or selects a new country. |
onlyCountries? | array | Country codes to be included. |
excludedCountries? | array | Country codes to be excluded. |
preferredCountries? | array | Country codes to be highlighted to the top of the list of countries. |
continents? | array | Continent codes to include a list of countries. |
forceCallingCode? | boolean | Force the calling code (e.g: +33 ) to be displayed so the value cannot be empty. Default false . |
focusOnSelectCountry? | boolean | Autofocus the input when the user selects a country in the list. Default false . |
disableDropdown? | boolean | No country list / The current flag is a span instead of a button . Default false . |
disableFormatting? | boolean | Remove format (spaces..) from the input value. Default false . |
langOfCountryName? | string | An Intl locale to translate countries (see Intl locales). Default en . |
MenuProps? | Menu API | Props for the Menu component. |
ref? | React.Ref<HTMLDivElement> | A ref pointing to the Mui TextField component. |
TextField Props |
While not explicitly documented above, the props of the TextField component are also available on MuiTelInput.
Global class | Description |
---|---|
.MuiTelInput-TextField | Styles applied to the root element. |
.MuiTelInput-IconButton | Styles applied to the IconButton of the current flag. |
.MuiTelInput-Flag | Styles applied to a flag. |
.MuiTelInput-Menu | Styles applied to Menu component. |
.MuiTelInput-MenuItem | Styles applied to a flag item of the Menu. |
.MuiTelInput-ListItemIcon-flag | Styles applied to the ListItemIcon of a flag item |
.MuiTelInput-ListItemText-country | Styles applied to the ListItemText of a flag item |
.MuiTelInput-Typography-calling-code | Styles applied to the calling code of a flag item |
You can override the style of the component with a global class name.
A "country code" is a two-letter ISO country code (like US
).
This library supports all officially assigned ISO alpha-2 country codes, plus a few extra ones like: AC
(Ascension Island), TA
(Tristan da Cunha), XK
(Kosovo).
Code | Continent |
---|---|
AF | Africa |
AS | Asia |
EU | Europe |
NA | North America |
OC | Oceania |
SA | South America |
OC | Oceania |
This library comes with TypeScript "typings". If you happen to find any bugs in those, create an issue.
Please file an issue for bugs, missing documentation, or unexpected behavior.
Please file an issue to suggest new features. Vote on feature requests by adding a 👍. This helps maintainers prioritize what to work on.
MIT
No vulnerabilities found.
No security vulnerabilities found.