0.2.4 • Published 2 years ago

filou-dialog-modal v0.2.4

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

Installation

filou dialog modal is available as an npm package.

// with npm
npm i filou-dialog-modal
// with yarn
yarn add filou-dialog-modal

Usage

Here is a quick example to get you started, it's all you need:

import React, { useState } from "react";
import { AlertDialog } from 'filou-dialog-modal';

export const App = () => {
  const [openModal, setOpenModal] = useState(false);
  
  const onOpenModal = () => setOpenModal(true);
  const onCloseModal = () => setOpenModal(false);

  const handleClickOpen = () => {
    onOpenModal();
  };
  return (
      <>
        <button type="button" onClick={handleClickOpen}>
          Open to open the dialog
        </button>
        
        <AlertDialog
            title="Modal Dialog Title"
            description="Praesent sapien massa, convallis a pellentesque nec."
            btnCloseContent="Close"
            open={ openModal }
            onCancel={ onCloseModal }
        />
      </>
  );
};
ReactDOM.render(<App />, document.querySelector('#app'));

Yes, it's really all you need to get started as you can see in this live and interactive demo:

Edit Button