Npm package to add a react Modal component
This project requires React and NPM. To make sure you have them available on your machine, try running the following command.
$ npm -v
These instructions will get you up and running on your local machine.
Here is the link of the npm folder: https://www.npmjs.com/package/dragovic-modal-package?activeTab=readme
Start with adding the package on your local machine:
$ npm install dragovic-modal-package
Import the package:
$ import { Modal } from 'dragovic-modal-package';
Add the state to control if the modal is visible or not ( Default to false ):
const [show, setShow] = useState(false);
Then add the modal component to the page:
<Modal title='' onClose={ ()=> setShow(false) } show={ show } />
You can change the content inside the modal by adding a title. Exemple:
<Modal title='Employee created' onClose={ ()=> setShow(false) } show={ show } />
- Mathias DRAGOVIC - Github