0.1.0 • Published 2 years ago

jsc-modal v0.1.0

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

jsc-modal

// with npm
npm i jsc-modal
// with yarn
yarn add jsc-modal

Usage

Please follow the instructions below to get started:

import React, { useState } from "react";
import { ModalDialog } from "jsc-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}>
        Click to open the dialog modal
      </button>

      <ModalDialog
        open={openModal}
        title="Title of the modal"
        description="Description of the modal"
        closeContent="Close"
        handleCloseModal={onCloseModal}
      />
    </>
  );
};
ReactDOM.render(<App />, document.querySelector("#app"));