1.1.4 • Published 3 years ago
react-simple-modal-gds v1.1.4
react-simple-modal-gds
Modal which is displayed after validation of a form. It includes opening, closing, and simple text parameters
Installation
- using NPM
$ npm install react-simple-modal-gds
Link to access the package here
Usage
Import Modal component in your React components:
import Modal from "react-simple-modal-gds";
Props
To use the component you need :
Props | Type | Required | Default | Description |
---|---|---|---|---|
handleChange | Object | Required | - | handleChange() is used to set a new state for the entry. |
value | Bool | Required | False | State allows you to display the modal |
content | String | Required | - | add text when the modal appears |
Settings
import Modal from "react-simple-modal-gds";
export default function App() {
const [open, setOpen] = useState(false);
const openModal = () => {
setOpen(!open);
};
return (
<>
<Modal content="Employee Created !" handleChange={setOpen} value={open} />
<button onClick={openModal}>button</button>
</>
);
}