npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-material-intl-tel-input

v19.1.0

Published

Angular Material international telephone input

Downloads

5,650

Readme

All Contributors

npm version npm downloads total npm downloads monthly

NgxMaterialIntlTelInput

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 | | --------------------------- | --------- | | 19.0.0 - 19.1.0 | >= 19.0.0 | | 18.0.0 - 18.2.1 | >= 18.0.0 | | 0.0.1 - 17.3.0 | >= 17.2.0 |

Installation

$ 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.

Usage

Import

Include the NgxMaterialIntlTelInputComponent in the imports array of the standalone component where you intend to utilize it.

imports: [NgxMaterialIntlTelInputComponent];

Example

<form [formGroup]="formGroup">
  <ngx-material-intl-tel-input [fieldControl]="control" [required]="true" [autoIpLookup]="false"> </ngx-material-intl-tel-input>
</form>

Options

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

Events

| 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. |

Contributors

Thanks goes to these wonderful people:

This project follows the all-contributors specification. Contributions of any kind are welcome!

"Buy Me A Coffee"