1.0.1 • Published 1 year ago

@augt/p14-modal v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

p14-modal

A simple React component pop-in modal that either shows an error message or a confirmation message.

Installation

It is recommanded to use Node.js v18 or newer. At the root of your React project, run the following command in your terminal to install the module:

npm install @augt/p14-modal

Usage

Use it in your app :

import { useState } from "react";
import { Modal } from "@augt/p14-modal";

function Component() {
  const [showModal, setShowModal] = useState(false);
  const errorMessage = "This is an error.";
  return (
    <>
      {showModal && (
        <Modal
          onClose={() => setShowModal(false)}
          errorMessage={errorMessage}
          confirmationMessage="Success !"
        />
      )}
    </>
  );
}

export default Component;

Props

Common props you may want to specify include:

  • onClose : A function that gets executed when the user clicks on the close button.
  • errorMessage : The error message that shows up on the modal.
  • confirmationMessage : The confirmation message that shows up on the modal.

License

MIT © augt

1.0.1

1 year ago

1.0.0

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.4

1 year ago

0.0.1

1 year ago