simple-library-modal-ocr-snrtn

1.3.0 • Public • Published

Simple Modal for React

This library provides a simple and easy-to-use modal component for React applications. It is implemented using MUI (Material UI).

Installation

To use this component, install it with the following command:

npm install simple-modal-library --save

Usage

The modal component can be used as follows:

import React, { useState } from 'react';
import Modal from 'simple-library-modal-ocr-snrtn';

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

  const openModal = () => {
    setIsModalOpen(true)
  }

  const closeModal = () => {
    setIsModalOpen(false)
  }

  return (
    <div className='App'>
      <button onClick={openModal}>open modal</button>
      <Modal isOpen={isModalOpen} onClose={closeModal}>
				<p>Employee Created!</p>
			</Modal>
    </div>
  )
}

export default App

API

The Modal component accepts the following props:

isOpen: A boolean value determining whether the modal is visible. onClose: A function called when the modal is closed. title: The title of the modal. (Optional) children: The content to be rendered inside the modal.

Styling

To customize the style of the modal, modify the Modal.css file.

License

This library uses the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i simple-library-modal-ocr-snrtn

Weekly Downloads

0

Version

1.3.0

License

MIT

Unpacked Size

9.46 kB

Total Files

7

Last publish

Collaborators

  • snrtn