react-ez-dialog
v0.1.0
Published
A Dialog is a type of modal window that appears in front of app content to provide critical information or ask for a decision.
Downloads
6
Readme
React Dialog
A Dialog is a type of modal window that appears in front of app content to provide critical information or ask for a decision.
Installation
To install, you can use npm or yarn:
npm install react-ez-dialog
yarn add react-ez-dialog
Usage
import React from 'react';
import { Dialog } from 'react-ez-dialog';
const Component:React.FC = () => {
const [open, setOpen] = React.useState(false);
return (
<>
<button onClick={() => setOpen(true)}>OPEN</button>
<Dialog open={open} onClose={() => setOpen(false)}>
<h1>Modal</h1>
<button onClick={() => setOpen(false)}>Close</button>
</Dialog>
</>
);
});
API
Hooks
useDialog
This hook makes you implement the Dialog component easily.
License
React Dialog is MIT licensed.