NPM link
This plugin was bootstrapped with Create-React-app .
show a basic modal , with close button.
npm i anissa_p14_modal
or
yarn add anissa_p14_modal
props | action | Example |
---|---|---|
show | state | if true the modal is open |
setshow | handler | modify the state by onClick On the button |
text | string | text of the modal |
// 1 - Import the Modal component into the file
import { Modal } from 'anissa_p14_modal';
const App = () => {
// 2 - Setup state and handler for the modal
const [modalIsOpen, setModalIsOpen] = useState(false);
return (
<>
<Modal
show={modalIsOpen}
setShow={setModalIsOpen}
text="Employee has been created!"
/>
</>
)
}
Anissa Mandhouj