{"id":28305756,"url":"https://github.com/rbalet/ngx-mat-input-tel","last_synced_at":"2026-02-12T00:20:52.804Z","repository":{"id":293114698,"uuid":"945428131","full_name":"rbalet/ngx-mat-input-tel","owner":"rbalet","description":"An Angular Material package for entering and validating international telephone numbers.","archived":false,"fork":false,"pushed_at":"2026-02-11T13:07:10.000Z","size":954,"stargazers_count":8,"open_issues_count":3,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-11T16:14:33.110Z","etag":null,"topics":["angular","angular-material","libphonenumber-js"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rbalet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"rbalet","custom":"https://www.buymeacoffee.com/widness"}},"created_at":"2025-03-09T11:59:40.000Z","updated_at":"2026-02-11T11:17:39.000Z","dependencies_parsed_at":"2025-05-13T19:17:22.196Z","dependency_job_id":"a8e95c62-a0b8-42ee-8bda-a3cfe1de16b8","html_url":"https://github.com/rbalet/ngx-mat-input-tel","commit_stats":null,"previous_names":["rbalet/ngx-mat-input-tel"],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/rbalet/ngx-mat-input-tel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbalet%2Fngx-mat-input-tel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbalet%2Fngx-mat-input-tel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbalet%2Fngx-mat-input-tel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbalet%2Fngx-mat-input-tel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rbalet","download_url":"https://codeload.github.com/rbalet/ngx-mat-input-tel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbalet%2Fngx-mat-input-tel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29347936,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T20:11:40.865Z","status":"ssl_error","status_checked_at":"2026-02-11T20:10:41.637Z","response_time":97,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angular-material","libphonenumber-js"],"created_at":"2025-05-24T02:13:21.699Z","updated_at":"2026-02-12T00:20:52.798Z","avatar_url":"https://github.com/rbalet.png","language":"TypeScript","funding_links":["https://github.com/sponsors/rbalet","https://www.buymeacoffee.com/widness"],"categories":[],"sub_categories":[],"readme":"# International Telephone Input for Angular Material (ngxMatInputTel)\n\nAn Angular Material package for entering and validating international telephone numbers. It adds a flag dropdown to any input, detects the user's country, displays a relevant placeholder and provides formatting/validation methods.\n\n[![npm version](https://img.shields.io/npm/v/ngx-mat-input-tel.svg)](https://www.npmjs.com/package/ngx-mat-input-tel)\n![NPM](https://img.shields.io/npm/l/ngx-mat-input-tel)\n![npm bundle size](https://img.shields.io/bundlephobia/min/ngx-mat-input-tel)\n![npm](https://img.shields.io/npm/dm/ngx-mat-input-tel)\n\n\u003cp align=\"center\" style=\"display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/rbalet/ngx-mat-input-tel/main/example-1.png\" /\u003e\n\u003c/p\u003e\n\n## Demo\n\n- https://stackblitz.com/~/github.com/rbalet/ngx-mat-input-tel\n\n## Caution\n\nThis is a fork from the [ngx-mat-intl-tel-input](https://github.com/tanansatpal/ngx-mat-intl-tel-input) library whish is not maintained anymore.\n\n**Supports:**\n\n| Angular | ngx-mat-input-tel |\n| ------- | ----------------- |\n| \u003e= 18   | \u003e= 19.2.0         |\n| \u003e= 15   | \u003c 19.2.0          |\n\n- Validation with [libphonenumber-js](https://github.com/catamphetamine/libphonenumber-js)\n\n## Installation\n\n### Install This Library\n\n`$ npm i ngx-mat-input-tel@latest`\n\n### Install Dependencies _Optional_\n\n`$ npm i libphonenumber-js@latest`\n\n## Usage\n\n### Import\n\nAdd `NgxMatInputTelComponent` to your component file:\n\n```ts\nimports: [NgxMatInputTelComponent]\n```\n\n## Example\n\nRefer to main app in this repository for working example.\n\n```html\n\u003cform #f=\"ngForm\" [formGroup]=\"phoneForm\"\u003e\n  \u003cngx-mat-input-tel\n    [preferredCountries]=\"['us', 'gb']\"\n    [enablePlaceholder]=\"true\"\n    [enableSearch]=\"true\"\n    name=\"phone\"\n    describedBy=\"phoneInput\"\n    formControlName=\"phone\"\n  \u003e\u003c/ngx-mat-input-tel\u003e\n\u003c/form\u003e\n```\n\n```html\n\n\u003cform #f=\"ngForm\" [formGroup]=\"phoneForm\"\u003e\n  \u003cngx-mat-input-tel\n  [preferredCountries]=\"['US', 'GB']\"\n  [enablePlaceholder]=\"true\"\n  [enableSearch]=\"true\"\n  name=\"phone\"\n  autocomplete=\"tel\"\n  (countryChanged)=\"yourComponentMethodToTreatyCountryChangedEvent($event)\" // $event is a instance of current select Country\n  formControlName=\"phone\"\u003e\u003c/ngx-mat-input-tel\u003e\n\u003c/form\u003e\n\n```\n\nIf you want to show the sample number for the country selected or errors, use mat-hint and mat-error as\n\n```html\n\u003cform #f=\"ngForm\" [formGroup]=\"phoneForm\"\u003e\n  \u003cngx-mat-input-tel\n    [preferredCountries]=\"['US', 'GB']\"\n    [onlyCountries]=\"['US', 'GB', 'ES']\"\n    [enablePlaceholder]=\"true\"\n    name=\"phone\"\n    autocomplete=\"tel\"\n    formControlName=\"phone\"\n    #phone\n  \u003e\u003c/ngx-mat-input-tel\u003e\n  \u003cmat-hint\u003ee.g. {{phone.$selectedCountry().placeholder}}\u003c/mat-hint\u003e\n  \u003cmat-error *ngIf=\"f.form.controls['phone']?.errors?.required\"\u003eRequired Field\u003c/mat-error\u003e\n  \u003cmat-error *ngIf=\"f.form.controls['phone']?.errors?.validatePhoneNumber\"\n    \u003eInvalid Number\u003c/mat-error\n  \u003e\n  \u003cmat-error *ngIf=\"f.form.controls['phone']?.errors?.countryNotAllowed\"\u003e\n    Country not allowed\n  \u003c/mat-error\u003e\n\u003c/form\u003e\n```\n\n## Inputs\n\n| Options            | Type                      | Default          | Description                                                                                                    |\n| ------------------ | ------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------- |\n| ariaLabel          | `string`                  | `Select country` | Aria label for the country selector button                                                                     |\n| autocomplete       | `off` \\| `tel`            | `off`            | For input autocompletion                                                                                       |\n| cssClass           | `string`                  | `undefined`      | If input custom class are needed                                                                               |\n| countriesName      | `Record\u003cstring, string\u003e`  | `COUNTRIES_NAME` | For using different country names in the dropdown (Eg. Multilingual website)                                   |\n| defaultCountry     | `CountryCode`             | `undefined`      | Default country code                                                                                           |\n| enablePlaceholder  | `boolean`                 | `false`          | Input placeholder text, which adapts to the country selected.                                                  |\n| enableSearch       | `boolean`                 | `false`          | Whether to display a search bar to help filter down the list of countries                                      |\n| format             | `string` \\*\\*\\*\\*         | `default`        | Format of \"as you type\" input. Possible values: national, international, default                               |\n| hideAreaCodes      | `boolean`                 | `false`          | Hide the Area codes in the country dropdown selection                                                          |\n| maxLength          | `number`                  | `15`             | max length of the input.                                                                                       |\n| onlyCountries      | `string[]`                | `[]`             | List of manually selected country abbreviations, which will appear in the dropdown.                            |\n| placeholder        | `string`                  | `undefined`      | Placeholder for the input component.                                                                           |\n| preferredCountries | `string[]`                | `[]`             | List of country abbreviations, which will appear at the top.                                                   |\n| resetOnChange      | `boolean`                 | `false`          | Reset input on country change                                                                                  |\n| searchPlaceholder  | `string`                  | `Search ...`     | Placeholder for the search input                                                                               |\n| validation         | `isPossible` \\| `isValid` | `isValid`        | Change the validation type                                                                                     |\n| separateDialCode   | `boolean`                 | `false`          | Whether to separate the dial code from the input _Note: you'll have to manually add margin-left to your input_ |\n\n## Outputs\n\n| Options        | Type                    | Default     | Description       |\n| -------------- | ----------------------- | ----------- | ----------------- |\n| countryChanged | `EventEmitter\u003cCountry\u003e` | `undefined` | On country change |\n\n## Css variable\n\n| Name                                   | Default        | Explanation                                                                                             |\n| -------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------- |\n| `--ngxMatInputTel-opacity`             | `0`            | If you wish both, the country flag and the placeholder to be shown by default                           |\n| `--ngxMatInputTel-selector-opacity`    | `0`            | If you wish the country flag to be shown by default                                                     |\n| `--ngxMatInputTel-placeholder-opacity` | `0`            | If you wish the placeholder flag to be shown by default                                                 |\n| `--ngxMatInputTel-flag-display`        | `inline-block` | If you wish to hide the country flag                                                                    |\n| `--ngxMatInputTel-menu-flag-display`   | `inline-block` | If you wish to hide the country flag inside the menu only                                               |\n| `--ngxMatInputTel-gap`                 | `32px`         | If you wish to change the gap between the flag and the input field (Only works with `separateDialCode`) |\n\n## Validator\n\n#### Manual validator usage\n\nIf you need to manually add the validator, use the factory:\n\n| Name                             | Description                                         | Example                                                                     |\n| -------------------------------- | --------------------------------------------------- | --------------------------------------------------------------------------- |\n| `ngxMatInputTelValidatorFactory` | Validator factory for phone and country restriction | `phoneControl.addValidators([ngxMatInputTelValidatorFactory(['US','GB'])])` |\n\n## Library Contributions\n\n- Fork repo.\n- Go to `./projects/ngx-mat-input-tel`\n- Update `./src/lib` with new functionality.\n- Update README.md\n- Pull request.\n\n### Helpful commands\n\n- Build lib: `$ npm run build_lib`\n- Copy license and readme files: `$ npm run copy-files`\n- Create package: `$ npm run npm_pack`\n- Build lib and create package: `$ npm run package`\n\n### Use locally\n\nAfter building and creating package, you can use it locally too.\n\nIn your project run:\n\n`$ npm install --save {{path to your local '*.tgz' package file}}`\n\n## Authors and acknowledgment\n\n- maintainer [Raphaël Balet](https://github.com/rbalet)\n- Forked from [ngx-mat-intl-tel-input](https://github.com/tanansatpal/ngx-mat-intl-tel-input)\n\n### Contributors\n\nContributions are welcome! See our [contribution notes](CONTRIBUTING.md).\n\n[\u003cimg alt=\"Contributor rbalet\" src=\"https://avatars.githubusercontent.com/u/44493964?v=4\u0026size=128\" width=64\u003e](https://github.com/rbalet)\n[\u003cimg alt=\"Contributor ChristianLoosliVGT\" src=\"https://avatars.githubusercontent.com/u/126682673?v=4\u0026size=128\" width=64\u003e](https://github.com/ChristianLoosliVGT)\n\n[![BuyMeACoffee](https://www.buymeacoffee.com/assets/img/custom_images/purple_img.png)](https://www.buymeacoffee.com/widness)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbalet%2Fngx-mat-input-tel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frbalet%2Fngx-mat-input-tel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbalet%2Fngx-mat-input-tel/lists"}