npm.io
0.1.2 • Published 3 years ago

simple-modal-component-library

Licence
Version
0.1.2
Deps
8
Size
5 kB
Vulns
0
Weekly
5

Simple modal react component library

npm package : https://www.npmjs.com/package/simple-modal-component-library /

Simple Modal component React is a library that allows to create modals easily with 3 different styles: SUCCESS (green), ERROR (red) and DANGER (orange) and 1 style by default.

Capture d’écran 2022-08-10 à 17 37 04Capture d’écran 2022-08-10 à 17 38 06Capture d’écran 2022-08-10 à 17 37 25

Style by default:(White)

modalw

Install

npm install --save simple-modal-component-library

Usage

In React app, use Modal components :
import { Modal } from "simple-modal-component-library"

Whrite the logic to show or hide the modal : \

showing

Whrite the logic to close the modal :

close

Use your component :

modal

Modal props

stylesModal (string): You have 3 possibilities SUCCESS, ERROR or DANGER to stylize your modal, this props is optional.
closeModal (function) : logic to close modal
label (string) : text you want to display

Keywords