1.0.4 • Published 4 years ago

modal-generator v1.0.4

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

ModalGenerator

Pop Up Creator on Click. Pass allowed selectors and whenever clicked on the specified selector a pop-up is generated at the cursor point. It can be used for showing tool tip on a click of some container, section.

Demo

Modal Generator Demo gif

Installation

npm i modal-generator --save

Then, we can use as the following

import { ModalGenerator } from "modal-generator";

ModalGenerator({
      modalHeight: 400,
      modalWidth: 400,
      heading: "Types of actions",
      content: `Dialog content`,
      cssClass: ["myClass", "test-class-to-be-applied"],
      allowedSelectorsClick: [".typography-demo", ".only-open-modal-on-click-of-these-selector"],
      cssStr: `.myClass {
          background-color: #ececec;
      }`,
    });

Detailed usage of the modal-generator can be seen via the demo examples.

Options

OptionDescriptionDefault Value
modalHeightheight of the modal150
modalWidthwidth of the modal300
headingheading for the modal, if heading is specified a cross icon is generated for closing the modal''
contentcontent of the modal, can accept HTML provided as string''
cssClassarray of css class that will applied to the modal container[]
allowedSelectorsClickarray specifying only these selector to open modal when clicked inside.[]
cssStradditional css can also be passed as string that will be applied on the modal html structure''