0.1.4 • Published 1 year ago
p14-modal-validate-plugin v0.1.4
Modal validate component
This is a simple and reutilisable React component fullscreen modal validate, developed as part of OpenClaasrooms training program for the 14th project. Its job is very basic ➡️ to display an alert when a form is validated.
Prerequisites
To use this component, you need :
- A text editor like : VSCode
- NodeJS > v.16
Installation
$ npm install p14-modal-validate-plugin
ou
$ yarn add p14-modal-validate-plugin
How the plugin works
Import module
import ModalValidate from 'p14-modal-validate-plugin'
Render your modal into your component
return (
<>
<ModalValidate />
<>
)
Props
This component uses three kinds of props :
- show : Boolean ▶️ manage the modal's display
- onClose : Function ▶️ handle the close's event
- message : String ▶️ display the alert message
Exemple :
< ModalValidate onClose={() => {
setShow(false)}}
show={ show } message={ 'Your message here !' }/>
Compatibility
This component was created with the last version of React (v18.2.0).
🤓 If you want to know more about this plugin, feel free to contact me !