Syncfusion Feedback

Trusted by the world’s leading companies

syncfusion trusted companies

Overview

The Angular Input Mask or masked text box is a component that provides an easy and reliable way to collect user input based on a standard mask. It allows you to capture phone numbers, date values, credit card numbers, and other standard format values.


Standard mask

The Angular Input Mask component supports the standard masks listed on MSDN.


Custom mask

Other than the standard mask elements, any custom character also can be a mask element by defining rules for it.


Regular expression

Angular Input Mask elements can be regular expressions, which is useful when defining user-specific data such as IP addresses.


Mask input combinations

The Angular Input Mask component allows different mask combinations based on the standard and custom masks. So, you can form different mask formats based on your application scenarios.

Angular Input Mask with number masking.

Number mask

From the standard mask elements, form a number mask for capturing any finite-length number to get inputs such as phone numbers and credit card numbers.

Angular Input Mask with string masking.

String mask

In the case of a country code or product key input, where the input string requires uppercase characters, the string mask format will enforce this.

Angular Input Mask with date masking.

Date mask

The Angular Input Mask can form any date format to get similarly formatted date values. This is helpful in getting culture-specific date values by defining the corresponding date mask.


Form support and validation

As a form component, the captured value of a masked textbox component proceeds in the raw format when submitting the form.

You can also integrate the form validator plugin to perform any custom validation.


Adornments

The Input Mask control supports custom adornments using the prependTemplate and appendTemplate properties, which allow users to render custom elements like icons, buttons, or dropdowns to enhance user interaction with prefix and suffix elements.


Angular Input Mask with mobile numeric keypad support.

HTML5 input type support

You can create a masked text box component from the HTML5 tel input. It opens the numeric keypad on mobile devices, which is useful for obtaining phone numbers or any other number-only inputs.


Other supported frameworks

The Input Mask is also available in Blazor, React, Vue, and JavaScript frameworks. Check out the different, platform-specific features through the following links:


Web accessibility

  • Fully supports WAI-ARIA accessibility to work with screen readers and assistive devices.
  • Follows WAI-ARIA best practices for implementing keyboard interaction.
  • Offers UI element visuals such as foreground color, background color, line spacing, text, and images designed based on the WCAG 2.0 standards.

Developer-friendly APIs

Developers can customize all UI elements and control behaviors of the Angular Input Mask according to the end user’s requirements using its rich set of client-side APIs.


Angular Input Mask code example

Easily get started with the Angular Input Mask by using a few simple lines of TS code, as demonstrated below. Also explore our Angular Input Mask example, which you how to render and configure the component.

<ejs-maskedtextbox mask="000-000-0000"></ejs-maskedtextbox>
import { Component} from '@angular/core';

@Component({
  selector: 'app-root',
// sets mask format to the MaskedTextBox
    template: `
        <ejs-maskedtextbox mask='000-000-0000'></ejs-maskedtextbox>
        `
})
export class AppComponent {
constructor() {
}
}



145+ ANGULAR UI COMPONENTS

Frequently Asked Questions

The Syncfusion Angular Input Mask provides the following features:

  • Allows users to enter only valid data through the input mask.
  • Supports custom mask formats with regular expressions (regex) to validate application-specific data.

  • Allows the validation of specific data formats such as date masks with different mask combinations and phone numbers masking in Angular.

  • Has simple configuration and APIs.
  • Supports all modern browsers.
  • Offers expansive learning resources such as demos and documentation to help you get started fast.

You can find our Angular Input Mask demo here.

No, this is a commercial product and requires a paid license. However, a free community license is also available for companies and individuals whose organizations have less than $1 million USD in annual gross revenue, 5 or fewer developers, and 10 or fewer total employees.

A good place to start would be our comprehensive getting started documentation.

Our Customers Love Us

Having an excellent set of tools and a great support team, Syncfusion® reduces customers’ development time.
Here are some of their experiences.

See Real Success Stories

Developers around the world trust Syncfusion’s Essential Studio to simplify complex projects and speed up delivery. With a vast library of UI controls, powerful SDKs, and reliable support, Essential Studio helps teams build enterprise-ready applications with confidence.

Explore Case Studies


Rated by users across the globe

Transform your applications today by downloading our free evaluation version
Download Free Trial No credit card required.

Awards

Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion® is proud to hold the following industry awards.

Up arrow icon