Creating Modals Using Vanilla Javascript Plugin | AwesomeModal

AwesomeModal is a lightweight JavaScript plugin for creating custom forms. Awesome Modal is a JavaScript class that enables you to display any contained content in a modal popup. Simple and easy-to-implement look as an ES unit.

reusable react modal component, react custom modal component, custom modal, native custom modal, modal functional component, open modal from another component

How to make use of it:

1. Import the AwesomeModal’s stylesheet into the doc.

<link rel="stylesheet" href="./css/AwesomeModal.css" />

2. Import the AwesomeModal element.

import AwesomeModal from './AwesomeModal.js';

3. Insert your modal content into the doc.

<div class="awesomeModal">
  <h2>This is awesome </h2>
  <p>Pure vanilla JavaScript modal component</p>

4. Create a brand new occasion of the AwesomeModal.

document.addEventListener('DOMContentLoaded', () => { 
  window.myModal = new AwesomeModal('.awesomeModal');

5. Launch the modal when wanted.;

6. Close the modal manually.


7. Customize the modal with the next parameters:

document.addEventListener('DOMContentLoaded', () => { 
  window.myModal = new AwesomeModal('.awesomeModal',{

    // CSS class of the background overlay
    overlayClass: "awesomeModal__overlay",

    // backgroud color
    overlayBackground: 'rgba(0,0,0,.1)',

    // close the modal by clciking the background overlay
    overlayCloseAbleDisabled: false,

    // enable/disable animation
    modalAnimateDisabled: false


8. Apply your individual styles to the modal.

.awesomeModal {
  background-color: #222;
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 5px;
  color: #fff;

Custom Modal Component, AwesomeModal Plugin/Github

See Demo And Download

Official Website(sellsteam13): Click Here

This superior jQuery/javascript plugin is developed by sellsteam13. For extra Advanced usage, please go to the official website.

Related Posts


Interactive Data Table Generator with JS/jQuery and JSON | Tabulator

Tabulator allows you to create interactive tables in seconds from any HTML Table, JavaScript array, AJAX data source, or JSON format data. Just include the library in your…


Simple Alert, Confirm, Prompt Popup Using Vanilla JavaScript Library | attention.js

JavaScript provides various built-in functionality to display popup messages for different purposes. Attention JS is a vanillaJS plugin used to create a custom alert, confirm, or Prompt…


Lightweight Bootstrap 4 Toast Notification Plugin | BS4 Advanced Toast

A lightweight Bootstrap 4 Toast Notification plugin integrated with JS/jQuery. bs4-toast.js is a JavaScript library that enhances the native Bootstrap toast component with icons, buttons, callbacks, and…


How to Create Audio Visualizations with JavaScript | Wave.js

Audio Visualizer Library – wave.js is a vanilla javascript audio visualization library that provides 20+ creative audio visualization effects to bring more engagement to your visitor. Contribute…


Modern Mobile Touch Slider With Acceleration Transitions | Swiper

Swiper is the most modern free mobile touch slider with accelerated device transitions and amazing original behavior. It is intended for use in mobile websites, mobile web…


Confetti Falling Animation Effect In JavaScript | party.js

Party.js is a JavaScript library to brighten user site experience with visual effects! Celebrate success with dom confetti! The library is written in TypeScript and compiled into…

Leave a Reply

Your email address will not be published. Required fields are marked *