1.0.2 • Published 1 year ago

jh-modal v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

jh-modal

Welcome to the jh-modal ! This package provides a simple and customizable modal component for React applications, designed to be easily integrated and styled according to your needs.

Table of Contents

Prerequisites

  • Node version: Node.js 14 or higher
  • IDE: However use whatever you feel most comfortable with.

Installation

Install my-project with npm

  npm install jh-modal

Usage

Basic Example

import React, { useState } from "react";
import Modal from "jh-modal";

const App = () => {
  const [isOpen, setIsOpen] = useState(false);

  const handleClose = () => {
    setIsOpen(false);
  };

  return (
    <div>
      <button onClick={toggleModal}>Open Modal</button>
      <Modal
        title="Employee successfully created"
        buttonName="Got it!"
        onClick={handleClose}
        onClose={handleClose}
      />
    </div>
  );
};

export default App;

Props

PropTypeDescription
titlestringTitle of the modal
subtitlestring | undefinedSubtitle of the modal
buttonNamestring | undefinedName of the button
onClosefuncCallback fired when the component requests to be closed
onClickfuncCallback fired when the button is clicked
backgroundColorstringCustom color on modal overlay
modalBackgroundColorstringCustom color on modal window
customCloseIconnodeCustom close icon
1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago