1.0.9 • Published 11 months ago
yunita_modal_package v1.0.9
This component displays a modal with a message in the center of the screen.
Install
via npm: npm i yunita_modal_package
Usage
The Modal component needs 2 props :
- {text} : the text to display in the modal
- {closeModal} : the function to close the modal. It actually should deactivate the visibility of the modal
Example:
import React from 'react';
import { useState } from "react"
import ModalWindow from 'yunita_modal_package'
export default function CreateForm() {
const [modalVisibile, setModalVisibile] = useState(true);
const closeModal = () => {
setModalVisibile(false);
}
return (
<div>
{modalVisibile &&<ModalWindow text="Employee Created !" closeModal={closeModal}/>}
</div>
)
}