dialog_popup
v0.1.8
Published
Création d'une librairie React (composant dialog)
Downloads
4
Maintainers
Readme
P14 Plugin React Dialog
Création d'une librairie React (composant dialog)
Installation
Install dialog_popup with npm
npm i dialog_popup
Usage/Examples
Importer le plugin :
import Modal from 'dialog_popup'
Creation du state dans le composant :
const [show, setShow] = useState(false);
Rendu :
<Modal title="My Modal" onValidate={() => setShow(false)} show={show}>
This is the modal
</Modal>
Example d'usage :
import React, { useState } from "react";
import Modal from "dialog_popup";
export default function App() {
const [show, setShow] = useState(false);
return (
<div className="App">
<button onClick={() => setShow(true)}>Show Modal</button>
<Modal title="My Modal" onValidate={() => setShow(false)} onCancel={cancelAction} show={show}>
This is the modal
</Modal>
</div>
);
}