0.1.7 • Published 2 years ago
react-modal-ib v0.1.7
modal-react
Installation
npm i react-modal-ib
import { Modal } from 'react-modal-ib';
Example
how to use react-modal-ib
import React, { useState } from "react";
import { Modal } from "react-modal-ib";
export const App = () => {
const [isShowing, setIsShowing] = useState(false);
function toggle() {
setIsShowing(!isShowing);
}
return (
<div>
<button onClick={toggle}>Open Model</button>
<Modal isShowing={isShowing} modalMessage="Employee Created!" toggle={toggle}/>
</div>
);
};
there is also a custom style
const customStyle = {
overlay: {
backgroundColor: "red",
},
content: {
borderRadius: "10px",
},
close: {
margin: "5px 17px",
fontSize: "14px",
},
};
<Modal Showing={isShowing} modalMessage="Employee Created!" toggle={toggle} style={customStyle} />;