manon-projet14
v1.0.46
Published
Modal of project 14
Downloads
19
Maintainers
Readme
Little confirmation Modal
Create a little modal with a confirmation message and a close button. This modal is a React's component.
How to add the modal
Installation
Add the modal to your project by executing npm i manon-projet14
Usage
Here's an example of usage :
import { ManonModal } from 'manon-projet14/dist'
import { useState } from "react"
function MyApp() {
const [isModalVisible, setIsModalVisible] = useState(false)
const handleSubmit = () => {
// add conditions before the action to confirmed
setIsModalVisible(true)
}
return (
<div>
<button onClick={handleSubmit}>Save</button>
{isModalVisible &&
<ManonModal methodeOff={() => setIsModalVisible(false)} />
}
</div>
)
}