modal-andreas
v1.2.5
Published
A simple component to show a modal
Downloads
9
Readme
⚛️ Modal-Andreas
A simple modal with different types.
liste of types :
- default
- componentInside
- confirmation
- formulaire
⚙️ Install
npm i modal-andreas --save
📖 Usage
import { Modal } from 'modal-andreas'
👀 Example
import { Modal } from 'modal-andreas';
const myComponent = () => {
const [isModalOpen, setIsModalOpen] = useState(false);
const [modalType, setModalType] = useState("default");
return (
<>
<Modal
isOpen={isModalOpen}
contentTitle={'ContentTitle'}
contentBody={'contentBody'}
onClose={handleClose}
success={modalSuccess}
modalSize={'600px'}
btnColor={'green'}
isClosable={true}
type={modalType}
>
<p>Component here</p>
</Modal>
<button onClick={() => {setModalType("componentInside"); setIsModalOpen(true); setModalSuccess(true)}}>Modal</button>
</>
)
}