# phpecoraro-npm-modal

> Modal component

Latest version **2.4.0** (published 2023-01-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install phpecoraro-npm-modal
pnpm add phpecoraro-npm-modal
yarn add phpecoraro-npm-modal
bun add phpecoraro-npm-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 | 2.4.0 |
| Published | 2023-01-02 |
| First published | 2022-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Philippe Pecoraro |
| Maintainers | phpecoraro |
| Keywords | modal, dialog, react, react-component, react-modal, react-dialog |

## Links

- npm: https://www.npmjs.com/package/phpecoraro-npm-modal
- npm.io page: https://npm.io/package/phpecoraro-npm-modal

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

- 2.4.0 (latest) — 2023-01-02
- 2.3.1 — 2023-01-02
- 2.2.1 — 2023-01-01
- 2.2.0 — 2022-12-29
- 2.1.1 — 2022-12-29
- 2.1.0 — 2022-12-29
- 2.0.0 — 2022-12-29
- 1.0.0 — 2022-12-29

## README

[![NPM](https://img.shields.io/npm/v/phpecoraro-npm-modal.svg)](https://www.npmjs.com/package/phpecoraro-npm-modal)
![npm](https://img.shields.io/npm/dm/phpecoraro-npm-modal)

# Npm Modal
Modal for react application. Custom modal appears after form validation.

**Contains:** 
- header title 
- body for message 
- close button

## Installation
To install:
```
npm install phpecoraro-npm-modal
```
## Exemple
Then use it in your React app:

```js
import { Modal } from 'phpecoraro-npm-modal'

<div>
    <button type="submit" className="formButton" onClick={() =>
        setShow(true)}
    >Save</button>
    <Modal title="Modal Title"
        onClose={() => setShow(false)} show={show}>
        <p>Modal Body</p>
    </Modal>
</div>

```
Enter your Title into "Modal Title", and your message into \<p>Modal Body\</p>
Show the modal when you click on the submit button.

**3 possibilities to close the modal:**
- modal close button
- escape keyboard key
- when you click outside the modal

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