react-modal-emmanuellets
v1.0.5
Published
react simple modal
Downloads
2
Readme
react-modal-emmanuellets
react simple modal
Install
npm install --save react-modal-emmanuellets
Usage
import React from 'react'
import Modal from 'react-modal-emmanuellets'
type AppProps = {
className: string
btnTexte: string
}
const Exemple = ({ className, btnTexte }: AppProps) => {
const [showModal, setShowModal] = useState(false)
const hideModal = () => showModal && setShowModal(false)
return (
<div className={className}>
<button
style={btnStyles}
className={className}
onClick={() => setShowModal(true)}
>
{btnTexte}
</button>
<Modal show={showModal} onClickCloseBtn={hideModal}>
Texte exemple!
</Modal>
</div>
)
}
##API
| Name | Type | Default | Description | | --------------- | -------------------------------- | ---------- | ---------------- | | show | boolean | false | Opens the modal. | | onClickCloseBtn | React.MouseEventHandler | false void | Close the modal. |
License
MIT © neverswood