react-minimal-modal
v2.1.0
Published
A react minimal modal library
Downloads
192
Maintainers
Readme
To install, you can use npm or yarn:
$ npm install --save react-minimal-modal
$ yarn add react-minimal-modal
Live demo
Examples
Here is a simple example of react-minimal-modal being used in a component:
import { useState } from 'react'
import Modal from 'react-minimal-modal'
export default function Component() {
const [isOpen, setIsOpen] = useState()
return (
<div>
<button onClick={() => setIsOpen(true)}>Open Modal</button>
<Modal open={isOpen} onOpenChange={setIsOpen} title="Hello">
<div>I am a modal</div>
</Modal>
</div>
)
}