Socket
Socket
Sign inDemoInstall

simple-library-modal-ocr-snrtn

Package Overview
Dependencies
88
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    simple-library-modal-ocr-snrtn

Made with create-react-library


Version published
Weekly downloads
1
decreased by-88.89%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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.

FAQs

Last updated on 03 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc