Symfony
Imask
Imask

There are few options on how to include/import Imask into your project:

Install from NPM

Install the Vanilla JS library using command prompt from the root directory of the project:

yarn add imask

How to link in page Imask package?

<script src="assets/libs/imask/imask.min.js"></script>

To apply Imask add the below code in the init.js file.

// Dynamic Mask (Credit Card)
const dynamicMaskElement = document.getElementById('dynamicMask');
const dynamicMask = IMask(dynamicMaskElement, {
    mask: '0000 0000 0000 0000',
    lazy: false,
    placeholderChar: '_'
});