šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Book a DemoInstallSign in
Socket

react-dark-modal

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dark-modal

Simple React modal component as a transparent dark overlay

0.1.2
latest
Source
npm
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
Ā 
Created
Source

react-dark-modal

Simple React modal component as a transparent dark overlay šŸŒ‘

NPM

Demo

react-dark-modal gif demo

šŸš€ Try react-dark-modal on CodeSandbox

Install

npm install --save react-dark-modal

OR

yarn add react-dark-modal

Usage

import React, { useState } from 'react';
import { Modal } from 'react-dark-modal';
import 'react-dark-modal/dist/index.css';

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

  const handleOpen = () => {
    setIsModalOpen(true);
  };

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

  return (
    <>
      <button onClick={handleOpen}>Open the modal</button>
      <Modal open={isModalOpen} onClose={handleClose}>
        <h1>Click elsewhere to close the modal</h1>
      </Modal>
    </>
  );
};

export default App;

License

MIT Ā© Yifan Ai

Keywords

modal

FAQs

Package last updated on 21 Dec 2020

Did you know?

Socket

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