kodobe-react-modal
v2.1.5
Published
Kodobe React Modal
Downloads
2
Readme
Kodobe React Modal
This is a simple react modal package
Install
npm install kodobe-react-modal
or
yarn add kodobe-react-modal
Setup
import Modal from 'kodobe-react-modal';
Usage
import Modal from "kodobe-react-modal";
function App() {
return (
<div>
<h3>Here is how to use a modal</h3>
<br />
<Modal isActive={modal} onClose={(e) => setModal(e)}>
<Upload
onChange={(e) => console.log(e)}
uploadUrl="https://api.devtot.com/message/file-upload"
fileName="file_upload"
/>
</Modal>
<Button onClick={() => setModal(true)}>Show Modal</Button>
</div>
);
}
Options
- children: Any thing
- isActive: (boolean) modal status
- clickOut: (boolean) determine if the modal can be closed by clicking out
- onClose: callback for when modal is closed (function)