Installation

Using CDN

<!-- First load the modal styles -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/layered-modal@latest/dist/styles.min.css">

<!-- Then, load the script, usually added to footer section -->
<script src="https://cdn.jsdelivr.net/npm/layered-modal@latest/dist/bundle.min.umd.js"></script>

<script>

    /**
    * Now lets display a modal on DOM load ...
    */

    document.addEventListener('DOMContentLoaded', function () {
        
        ModalManager.instance.addModal({
            body : {
                content : 'Hello world!'
            } 
        });
        
    });
</script>

Using directly from node_modules/layered-modal directory

<!-- First load the modal styles -->
<link rel="stylesheet" href="./node_modules/layered-modal/dist/styles.min.css">

<!-- Then, load the script, usually added to footer section -->
<script src="./node_modules/layered-modal/dist/bundle.min.umd.js"></script>

<script>

    /**
    * Now lets display a modal on DOM load ...
    */

    document.addEventListener('DOMContentLoaded', function () {
        
        ModalManager.instance.addModal({
            body : {
                content : 'Hello world!'
            } 
        });
        
    });
</script>