
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
ngx-material-intl-tel-input
Advanced tools
https://github.com/juanjotorres90/ngx-material-intl-tel-input
Introducing an Angular library designed to streamline the input and validation of international telephone numbers. Integrates a searchable material select component for convenient country code selection. Moreover, it automatically detects the user's country, dynamically presenting a relevant placeholder for enhanced user experience. With built-in formatting and validation functionalities, this library ensures accuracy and consistency in handling telephone numbers across diverse global contexts.
Check out the Demo
Compatibility:
Validation with google-libphonenumber
| ngx-material-intl-tel-input | Angular |
|---|---|
| 20.0.0 - 20.1.2 | 20 |
| 19.0.0 - 19.2.1 | 19 |
| 18.0.0 - 18.2.1 | 18 |
| 0.0.1 - 17.3.0 | 17 |
$ npm install ngx-material-intl-tel-input --save
Ensure to include provideAnimations() and provideHttpClient() in the providers array of your main.ts file to initialize your application with animations and auto getting country code capabilities. Refer to the Angular Docs provideAnimations and provideHttpClient for detailed instructions.
Additionally, it's essential to incorporate an Angular Material theme by importing the necessary CSS for styling. Please consult the Angular Material Theming guide for instructions on how to set up the theme.
Include the NgxMaterialIntlTelInputComponent in the imports array of the standalone component where you intend to utilize it.
imports: [NgxMaterialIntlTelInputComponent];
<form [formGroup]="formGroup">
<ngx-material-intl-tel-input [fieldControl]="control" [required]="true" [autoIpLookup]="false"> </ngx-material-intl-tel-input>
</form>
| Options | Type | Default | Description |
|---|---|---|---|
| fieldControl | FormControl | FormControl('') | Form control required to retrieve the value. |
| fieldControlName | string | '' | Form control name to assign the control from a FormGroup. |
| required | boolean | false | Telephone field input required. |
| disabled | boolean | false | Telephone field input disabled. |
| appearance | 'fill' | 'outline' | fill | Material form field appearance. |
| autoIpLookup | boolean | true | Sets initial country code based on user's ip. |
| autoSelectCountry | boolean | true | Enables or disables auto selecting a country on initialization. |
| autoSelectedCountry | CountryISO | string | '' | Sets the country to be auto selected. |
| numberValidation | boolean | true | Enables or disables phone number validation. |
| enableSearch | boolean | true | Enables or disables country search. |
| includeDialCode | boolean | false | Includes the dial code in the phone number input. |
| emojiFlags | boolean | false | Use standard emoji icons for the country flags. |
| hidePhoneIcon | boolean | false | Hides phone icon. |
| preferredCountries | (CountryISO | string)[] | [] | Shows the specified countries on top of the list. |
| visibleCountries | (CountryISO | string)[] | [] | Shows only the specified countries. |
| excludedCountries | (CountryISO | string)[] | [] | Exclude the specified countries from the list. |
| enablePlaceholder | boolean | true | Input placeholder text for every country national number. |
| iconMakeCall | boolean | true | Click on phone icon to trigger call action. |
| initialValue | string | '' | Sets initial telephone number value |
| useMask | boolean | false | Use mask for phone number input. |
| forceSelectedCountryCode | boolean | false | If useMask is active it forces the selected country code to be displayed |
| showMaskPlaceholder | boolean | false | If useMask is active it shows the placeholder for the mask |
| outputNumberFormat | PhoneNumberFormat | PhoneNumberFormat.INTERNATIONAL | Sets the output number format to INTERNATIONAL, E164, or RFC3966 format |
| enableInputMaxLength | boolean | true | Enables or disables the input max length. |
| textLabels | TextLabels | {mainLabel: 'Phone number', codePlaceholder: 'Code', searchPlaceholderLabel: 'Search', noEntriesFoundLabel: 'No countries found', nationalNumberLabel: 'Number', hintLabel: 'Select country and type your phone number', invalidNumberError: 'Number is not valid', requiredError: 'This field is required'} | Overrides all component text labels |
| mainLabel | string | '' | Sets the main label of the input field. It overrides the textLabels.mainLabel. |
| Event | Type | Default | Description |
|---|---|---|---|
| currentValue | string | '' | Full phone number value emitted when the value of the input changes. |
| currentCountryCode | string | '' | Country code value emitted when the value of the input changes. |
| currentCountryISO | string | '' | Country ISO value emitted when the value of the input changes. |
--mdc-filled-tel-form-outline-width: Outline width (default: 1px)--mdc-filled-tel-form-outline-color: Border color (default: #d8d8d8)--mdc-filled-tel-form-background: Background color (default: #fbfbfb)--mdc-filled-tel-form-container-shape: Border radius (default: 8px)--mdc-filled-tel-form-focus-outline-color: Focus border color (default: rgb(32, 159, 252))--mdc-filled-tel-form-focus-background: Focus background (default: #fff)--mdc-filled-tel-form-hover-background: Hover background (default: #f5f5f5)--mdc-outline-tel-form-hover-background: Outline variant hover background (default: #f5f5f5)--mdc-outline-tel-form-background: Outline variant background (default: #fbfbfb)--mdc-tel-form-placeholder-color: Input placeholder color (default: #ccc)--mdc-tel-form-icon-color: Action icon color (default: #909090)--mdc-outlined-tel-form-container-shape: Outline field border radius (default: Material system variable)--mdc-outlined-text-field-container-shape: Text field border radius (default: Material system variable)--mdc-tel-form-hint-color: Hint text color (default: #b2b2b2)--mdc-tel-form-error-color: Error message color (default: Material system error)--mat-sys-error: Material system error fallback (default: #f44336)--mdc-theme-primary: Primary theme color (default: rgb(32, 159, 252))--mdc-theme-error: Error state color (default: #f44336)--mat-sys-corner-extra-small: Material system small corner radius:root {
/* Container Customization */
--mdc-filled-tel-form-background: #f8f9fa;
--mdc-filled-tel-form-container-shape: 6px;
/* Theme Colors */
--mdc-theme-primary: #2a7de1;
--mdc-tel-form-error-color: #dc3545;
/* Input Styling */
--mdc-tel-form-placeholder-color: #a0aec0;
}
Thanks goes to these wonderful people:
This project follows the all-contributors specification. Contributions of any kind are welcome!
[20.1.2] - 2025-10-08
FAQs
Angular Material international telephone input
The npm package ngx-material-intl-tel-input receives a total of 3,819 weekly downloads. As such, ngx-material-intl-tel-input popularity was classified as popular.
We found that ngx-material-intl-tel-input demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
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.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.