1.0.5 • Published 5 years ago
react-modal-comp
Licence
ISC
Version
1.0.5
Deps
0
Size
5 kB
Vulns
0
Weekly
0
Component example
import { useState } from 'react'
import {Modal} from 'react-modal-comp'
function App() {
const [visible, setVisible] = useState(false)
return (
<div className="App">
<button onClick={() => setVisible(true)}>Active modal</button>
<Modal showModal={visible} closeModal={() => setVisible(false)} bodyClass='component-body-modal'>
Modal box
</Modal>
</div>
)
}
export default App
Component Props
| Props | Type | Desc |
|---|---|---|
| showModal | boolean | show/hide modal |
| closeModal | fn | return the action to close the modal |
| overlayClass | string | overlay className |
| bodyClass | string | body className |