
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
material-modal
Advanced tools
Click here for a demo.
An animated modal dialog styled for use with Material Design Lite.
bower install material-modal --save
npm install material-modal --save
After Bower or NPM install, copy the files from dist/css and dist/js to your project's assets folder.
Clone repo, or download zip.
A working sample is available in the download, in the 'demo' folder.
Create an element with the class .modal__trigger. Add the data-modal attribute with a value of the id of the target modal.
Create a div with the class .modal, with another nested div with the class .modal__content.
Optionally you can add a .modal__header and .modal__footer. To close the modal, you can click the background, or create an element with the class .modal__close.
Here is a sample HTML structure using Material Design Lite:
...
<html>
<head>
<meta charset="UTF-8">
<title>Material Design Modal Demo</title>
<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.5/material.indigo-pink.min.css"> <!-- Default MDL CSS -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> <!-- MDL Icons -->
<link rel="stylesheet" href="../dist/css/material-modal.min.css">
</head>
<body>
<div class="content"> <!-- For Demo Only -->
<a href="" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored modal__trigger" data-modal="#modal">
Launch Modal
</a>
<div id="modal" class="modal modal__bg">
<div class="modal__dialog">
<div class="modal__content">
<div class="modal__header">
<div class="modal__title">
<h2 class="modal__title-text">Modal</h2>
</div>
<span class="mdl-button mdl-button--icon mdl-js-button material-icons modal__close"></span>
</div>
<div class="modal__text">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Debitis laboriosam accusantium facere suscipit, alias accusamus corrupti consequatur at porro, voluptates commodi sed omnis voluptatem, ex officiis illum, architecto fugiat id?
</p>
</div>
<div class="modal__footer">
<a class="mdl-button mdl-button--colored mdl-js-button modal__close">
Close
</a>
</div>
</div>
</div>
</div>
</div>
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.5/material.min.js"></script> <!-- MDL JavaScript -->
<script src="path/to/js/material-modal.min.js"></script>
</body>
</html>
Feel free to do what you'd like with this. Clone or fork the repo, type npm install and have your way with it. Use grunt build to compile Less to CSS, lint and minify JS, and update the dist and demo folders. Use grunt default to run the build, and continue to watch the Less and JavaScript files for changes.
Material Modal © 2015-2017, Mark Rabey. Released under the MIT License.
Authored and maintained by Mark Rabey
markrabey.com · GitHub @MarkRabey · Twitter @MarkRabey
FAQs
A modal dialog for use with Material Design Lite
We found that material-modal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.