2.1.3 • Published 3 years ago

@midly/react-modal v2.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

React-modal

npm package npm package npm package npm package

React-modal is a simplest way to create dialog on your ReactJS site.

  • Small (less than 45Kb)
  • Mobile friendly
  • Without dependencies

Getting Started

Install this package:

npm i @midly/react-modal

Import the component:

import {Modal} from '@midly/react-modal';
import {ModalRef} from '@midly/react-modal/dist/esm/Modal'

const modalRef = useRef<ModalRef>(null)

<Modal ref={modalRef}>Your content</Modal>

You can then render the Modal component like any other React component in JSX.

const showModal = useCallback<SubmitHandler>(() => modalRef.current?.open(), [])

<button className="button" onClick={showModal}>Open modal</button>
2.1.3

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

1.1.1

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago