Input Mask provides ready-made directives for formatting credit card inputs while the user types. Use the mask directives on native input elements, usually together with ngsInput inside ngs-form-field.
The available masks are ngsCreditCardNumberMask, ngsCreditCardExpiryDateMask, and ngsCreditCardCvvMask. They format the visible value, set useful mobile keyboard and autocomplete attributes where applicable, and write a cleaned form value for card number and expiry.
Do not treat Input Mask as a universal mask engine, validator, payment security layer, or compliance solution. Do not use it for phone numbers, custom IDs, tax numbers, IBAN, postal codes, date pickers, selects, currency or country fields, or formatting already saved data. Use PhoneInput, dedicated field components, validators, backend checks, or a custom mask directive for those cases.
- Formats card number, expiry date, and CVV/CVC fields while users type.
- Works with native inputs and NgStarter Input/FormField composition.
- Keeps form values cleaner than the visible formatted text where supported.