@asosunoff/react-modal
v0.0.4
Published
modal component
Downloads
10
Readme
Modal component React
Demo:
https://asosunoff.github.io/React-Modal/
Install component
Launch project:
git clone https://github.com/aSosunoff/React-Modal.git
cd React-Modal
npm i
npm run start
Test project:
npm test
Example
Slots
Modal.Title - optional
Modal.Body - optional
Modal.Footer - optional
import Modal from "@asosunoff/react-modal";
const App = () => {
const { isShow, show, hide } = useShow(false);
return (
<>
<Modal isShow={isShow} onHideModal={hide}>
<Modal.Title>Title</Modal.Title>
<Modal.Body>Body</Modal.Body>
<Modal.Footer>Footer</Modal.Footer>
</Modal>
<BaseButton onClick={isShow ? hide : show}>Show</BaseButton>
</>
);
};