react-ez-dialog

    0.1.0 • Public • Published

    React Dialog test GitHub license npm version

    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.

    Install

    npm i react-ez-dialog

    DownloadsWeekly Downloads

    3

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    864 kB

    Total Files

    60

    Last publish

    Collaborators

    • thomasjs8