# react-modal-v2

> React modal

Latest version **1.0.3** (published 2018-08-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-modal-v2
pnpm add react-modal-v2
yarn add react-modal-v2
bun add react-modal-v2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-08-23 |
| First published | 2018-08-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | yicheng |
| Maintainers | easonwang01 |
| Keywords | react, modal |

## Links

- npm: https://www.npmjs.com/package/react-modal-v2
- Repository: https://github.com/EasonWang01/react-modal-v2
- Homepage: https://github.com/EasonWang01/react-modal-v2#readme
- Issues: https://github.com/EasonWang01/react-modal-v2/issues
- npm.io page: https://npm.io/package/react-modal-v2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2018-08-23
- 1.0.2 — 2018-08-23
- 1.0.1 — 2018-08-22
- 1.0.0 — 2018-08-22

## README

# Install
```
npm install react-modal-v2
```

# Import

```js
import { Modal } from 'react-modal-v2';
```

# Example

```js
import React, { Component } from 'react';
import { Modal } from 'react-modal-v2';

class App extends Component {
  constructor() {
    super();
    this.state = {
      showModal: false,
    }
  };
  render() {
    return (
      <div className="App">
        <button onClick={() => this.setState({ showModal: true })}>Open</button>
        {
          this.state.showModal ?
            <Modal modalOutsideClick={() => this.setState({ showModal: false })}>
              <div>content</div>
              <button onClick={() => this.setState({ showModal: false })}>Close</button>
            </Modal> : ''
        }
      </div>
    );
  }
}

export default App;
```

# Props

- modalOutsideClick
> Trigger when user click on the modal background.
- modalOutsideStyle
> Custom modal background style.
- modalInsideStyle
> Custom modal content style.

---
_Source: https://npm.io/package/react-modal-v2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
