react-portal-modal
This is a Customizable Modal.
Usage
;;;; const App = { const isOpen setOpen = ; const open = ; const close = ; return <div> <button onClick=open>OPEN</button> <Modal isOpen=isOpen close=close> <div className=stylesmodal> <h1>Title</h1> <p>This is a react-portal-modal</p> </div> </Modal> </div> ;};;
Props
property | Required | Type | description | example | default |
---|---|---|---|---|---|
isOpen | required | Boolean | whether the modal is open | false | false |
close | required | Function | close the modal | - | - |
elementId | option | String | an element id for which the modal is output | 'root', 'app', etc... | 'root' |
How To Develop
Setup
$ npm install
Build
$ npm run build
Example
$ npm start
License
MIT