A mask formats a text field as people type: 00/00/0000 puts in the slashes, AA 000 AA takes letters and digits in turn. Characters that don’t fit stay out, and the caret keeps its place when people type in the middle.

Masks are made of tokens and literals: 0 is a digit, a a letter, * either, and A and X are the same for codes, in upper case. Add your own with tokens, or pass a function that picks the mask for what’s typed, as nuiCardMask does by card brand.

The value is what’s shown, or only the data with unmask. The mask works with Signal Forms, reactive forms and ngModel, and an unfinished value is an error.

Formats

A date, a time, a licence plate, and a color with a token of its own for hexadecimal digits.

— · — · — · —

Payment details

Signal Forms fields. The card mask follows the brand, the security code has four digits for American Express, and nuiCardValid and nuiIbanValid check the numbers.

Card: — · IBAN: —