1.0.13 • Published 2 years ago
modal-module-thiw v1.0.13
Custom modal for Wealth Health company.
Installation
You can install modal-module-thiw with npm
npm i modal-module-thiw
Import
You need to import component and CSS
import Modal from "modal-module-thiw";
import "modal-module-thiw/dist-unminified/index.css";
<Modal />
Opening
The modal is invisible by default.
To display the modal you must pass the value open
to the argument setIsModalProp={'open'}
import Modal from "modal-module-thiw";
import "modal-module-thiw/dist-unminified/index.css";
function MyComponent() {
return (
<>
<Modal setIsModalProp={'open'} isModal={'open'} />
</>
)
}
Closing
To hide the modal you must pass the value closed
to the argument setIsModalProp={'closed'}
or click on the 'close' button directly on the modal.
Options
To modify the content of modal you must use the argument content={}
.
To change the appearance of the modal you must pass an object to the argument modalStyle={}
example :
import Modal from "modal-module-thiw";
import "modal-module-thiw/dist-unminified/index.css";
function MyComponent() {
return (
<>
<Modal content={myContent} modalStyle={{backgroundColor: "red", justifyContent: "left"}} />
</>
)
}
list of available style arguments :
backgroundColor,
fontSize,
justifyContent,
width,
height,
color,
boderStyle,
borderWidth,
borderColor,
borderRadius,