New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

easy-modal-hook

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-modal-hook

Simple React Modal Hook that can be attached to any html element

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

Easy-Modal-Hook


Introduction

Easy-Modal-Hook is a simple React Modal Hook that can be attached to any html element


Quick Start

Install from:

npm install easy-modal-hook

Usage example:

import { useModal } from 'easy-modal-hook'

function App(): JSX.Element {
  const { Modal, open } = useModal({
    // Specify any html element id to attach the modal
    root: 'any-id',
    // Specify a custom icon to the close button (Default: Close)
    closeIcon: <SvgClose />
  })

  return (
    <div>
      <button onClick={open}>Open</button>
      <Modal>
        <>Hello World!</>
      </Modal>
    </div>
  )
}

License

The MIT License.

Keywords

React

FAQs

Package last updated on 21 May 2023

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