Phone
PHONE

This mask is based on the libphonenumber-js package.

Use maskitoPhoneOptionsGenerator to create a mask for phone input.

basic

Kazakhstan phone example

    
    
    
    
    
    
    
    
    
    

validation

For validating phone number you can use isValidPhoneNumber , isPossiblePhoneNumber functions from libphonenumber-js package. Read more

Below is an example of a Hungarian phone mask with an angular validator.

    
    
    
    

Non-strict mask

Setting the strict option to false enables non-strict mask mode and allow user to type any country phone number.

The countryIsoCode option is optional in that case, but if you specify it, the mask will try to add that country's calling code when you try to insert a phone number without a calling code.

    
    
    
    

Lazy metadata

You can load metadata lazily, below is an example of how to do it in Angular.

You can also customize the metadata to reduce metadata size. See instructions here