1.0.6 • Published 4 months ago

employee-modal v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

Employee-Modal

A simple, reusable React modal component for displaying messages, such as confirmation after an employee is successfully created.

Installation

npm i employee-modal

Usage

Import and use the EmployeeModal component in your React project:

import React, { useState } from 'react';
import EmployeeModal from 'employee-modal';

const ExampleComponent = () => {
  const [isModalOpen, setIsModalOpen] = useState(false);

  return (
    <div>
      <button onClick={() => setIsModalOpen(true)}>Open Modal</button>
      <EmployeeModal
        isOpen={isModalOpen}
        onClose={() => setIsModalOpen(false)}
        message="Employee successfully created!"
      />
    </div>
  );
};

export default ExampleComponent;

Props

PropTypeRequiredDescription
isOpenbooleanControls whether the modal is visible (true) or hidden (false).
onClosefunctionFunction that handles closing the modal when the button is clicked.
messagestringOptional message to display inside the modal.

Version & Dependencies

Node version: 18.16.1

IDE: Visual Studio Code

This package requires the following dependencies:

"react": ">=18.2.0",
"react-dom": ">=18.2.0",
"prop-types": "^15.8.1"
1.0.6

4 months ago

1.0.5

4 months ago

1.0.4

4 months ago

1.0.3

4 months ago

1.0.2

4 months ago

1.0.0

4 months ago