PopupKit is an NPM package that you can call from one line of JavaScript code to display a nice-looking popup modal.
- Fixed CSS import error
npm i popupkit
yarn add popupkit
After installation, paste this into your html file's <head>
tag:
<script src="./node_modules/popupkit/index.min.js"></script>
Or if you'd rather use a CDN, paste this inside the <head>
tag instead:
<script src='https://unpkg.com/[email protected]/index.min.js'></script>
All you need is one line of JavaScript code. Yep! You heard me right. One line is all you need.
popupkit.simpleLight("This is the title", "This is the message.", () => {
console.log("Popup is closed")
});
- Call the popupkit object
- Call in the theme function
- Type title in the first parameter
- Type title in the second parameter
- (OPTIONAL) Write a callback function for when he user closes the popup
Theme function | Description |
---|---|
simpleLight() | A simple light-themed popup |
simpleDark() | A simple dark-themed popup |
blackAndWhite() | A black and white popup |
blueAndWhite() | A blue and white popup |
redAndWhite() | A red and white popup |
yellowAndWhite() | A yellow and white popup |
greenAndWhite() | A green and white popup |
More to come! 😉
This project is licensed under the MIT License - see the MIT License file for details.