1.0.4 • Published 7 months ago

abaabil.dialog v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

abaabil.dialog

An easy-to-use, customizable dialog (modal) component for React.

Installation

npm install abaabil.dialog

Usage

import Dialog from 'abaabil.dialog';

function MyApp() {
  const [isOpen, setIsOpen] = React.useState(false);

  return (
    <div>
      <button onClick={() => setIsOpen(true)}>Open Dialog</button>

      <Dialog
        isOpen={isOpen}
        dialogTitle="My Dialog Title"
        onClose={() => setIsOpen(false)}
      >
        <p>Your content goes here...</p>
      </Dialog>
    </div>
  );
}

Props

  • dialogTitle (string): The title to display at the top of the dialog.
  • children (node): The content to be displayed inside the dialog.
  • onClose (function, required): A handler function to be called when the close button is clicked.
  • isOpen (boolean, required): A boolean to control the visibility of the dialog.

License

MIT

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago