
Phone Input is a specialized form control for phone numbers with country selection, flag, dial code, formatting, and validation through libphonenumber-js.
Use it in profile, contact, billing, onboarding, checkout, support, invite, and contact forms when the value must be a real phone number.
Place ngs-phone-input inside one ngs-form-field and use Angular forms with formControlName or ngModel. Show invalidPhone with ngs-error. Use onlyCountries to limit available countries and preferredCountries to pin common countries to the top of the menu.
Do not use plain ngsInput, NumberInput, or InputMask for country-aware phone numbers. Do not use CountrySelect instead of PhoneInput; CountrySelect only chooses a country. Do not use PhoneInput for OTP, MFA, passcodes, or invite codes; use PinInput.
Key features:
- Country selection with flag and dial code.
- Country-aware formatting and validation.
- Preferred and restricted country lists.
- Angular forms integration and invalidPhone errors.