# @alexseitsinger/react-simple-modal

> A simple react modal

Latest version **5.1.2** (published 2020-02-26) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install @alexseitsinger/react-simple-modal
pnpm add @alexseitsinger/react-simple-modal
yarn add @alexseitsinger/react-simple-modal
bun add @alexseitsinger/react-simple-modal
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.1.2 |
| Published | 2020-02-26 |
| First published | 2019-06-05 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 804.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alex Seitsinger |
| Maintainers | alexseitsinger |
| Keywords | react, modal |

## Links

- npm: https://www.npmjs.com/package/@alexseitsinger/react-simple-modal
- Repository: https://github.com/alexseitsinger/react-simple-modal
- Issues: https://github.com/alexseitsinger/react-simple-modal/issues
- npm.io page: https://npm.io/package/@alexseitsinger/react-simple-modal

## Dependencies (6)

- [core-js](https://npm.io/package/core-js.md) 3.6.4
- [underscore](https://npm.io/package/underscore.md) ^1.9.2
- [@emotion/core](https://npm.io/package/@emotion/core.md) 10.0.27
- [computed-style](https://npm.io/package/computed-style.md) ^0.3.0
- [@emotion/styled](https://npm.io/package/@emotion/styled.md) 10.0.27
- [react-focus-lock](https://npm.io/package/react-focus-lock.md) ^2.2.1

## 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

- 5.1.2 (latest) — 2020-02-26
- 5.1.0 — 2020-02-16
- 5.0.0 — 2020-02-16
- 4.0.0 — 2020-02-11
- 3.1.0 — 2020-02-11
- 3.0.0 — 2020-02-03
- 2.0.1 — 2020-02-02
- 2.0.0 — 2020-02-02
- 1.3.0 — 2020-01-17
- 1.0.1 — 2019-12-13
- 1.0.0 — 2019-12-13
- 0.8.1 — 2019-11-30
- 0.8.0 — 2019-11-30
- 0.7.0 — 2019-11-02
- 0.5.0 — 2019-09-13
- … 4 more at https://npm.io/package/@alexseitsinger/react-simple-modal/versions

## README

# SimpleModal

A simple modal

## Installation

```bash
yarn add @alexseitsinger/react-simple-modal
```

## Props

Name                 | Description                                             | Default                   | Required
---                  | ---                                                     | ---                       | ---
modalName            | The unique name of the modal.                           | undefined                 | true
containerClassName   | Custom classname to use for the modal.                  | "SimpleModal"             | false
containerLayer       | The default z-index to use for the modal                | 200                       | false
backgroundShade      | The background color to use for the modal's background. | "dark"                    | false
onClickBackground    | Invoked when the background is clicked.                 | undefined                 | false
closeButtonClassName | The class name to use for the close button.             | "SimpleModal-CloseButton" | false
isCloseButtonVisible | Show the close button                                   | false                     | false
closeButtonStyle     | Additional css to apply to the close button             | undefined                 | false
renderCloseButton    | Invoked to render the button body                       | undefined                 | false
onEscapeKey          | Invoked whenever the escape key is pressed.             | undefined                 | false
children             | The content to render in the modal                      | undefined                 | false

## Example

```javascript
// Within App root
import { SimpleModalProvider } from "@alexseitsinger/react-simple-modal"

function App({ store, history }) {
  return (
    <Provider store={store}>
      <ConnectedRouter history={history}>
        <SimpleModalProvider>
          <Route patch={"/"} exact component={HomePage} />
        </SimpleModalProvider>
      </ConnectedRouter>
    </Provider>
  )
}
```

```javascript
// Within app page
import { SimpleModal } from "@alexseitsinger/react-simple-modal"

function HomePage() {
  return (
    <SimpleModal
      modalName={"home-page-modal"}>
      <div>Some modal content.</div>
    </SimpleModal>
  )
}
```

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