# react-simple-promise-modal

> Capture modal responses.

Latest version **1.0.5** (published 2020-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-simple-promise-modal
pnpm add react-simple-promise-modal
yarn add react-simple-promise-modal
bun add react-simple-promise-modal
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2020-08-15 |
| First published | 2020-02-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 3 |
| Unpacked size | 42.5 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | lilaceproductions |
| Maintainers | fwalson |

## Links

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

## Dependencies (3)

- [jquery](https://npm.io/package/jquery.md) ^3.4.0
- [bootstrap](https://npm.io/package/bootstrap.md) ^3.3.7
- [popper.js](https://npm.io/package/popper.js.md) ^1.16.1

## Recent versions

- 1.0.5 (latest) — 2020-08-15
- 1.0.4 — 2020-03-04
- 1.0.3 — 2020-03-04
- 1.0.2 — 2020-02-25
- 1.0.1 — 2020-02-24
- 1.0.0 — 2020-02-24

## README

## Thanks for visiting

A react customizable modal that can be used to capture a user's response to the modal. Include prompt for text response. Easy integration. Uses Bootstrap 3. 

[Demo](https://calabashlabsllc.github.io/react-simple-promise-modal/)

[![NPM](https://img.shields.io/npm/v/react-simple-promise-modal.svg)](https://www.npmjs.com/package/react-simple-promise-modal) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

### Install

```bash
npm install --save react-simple-promise-modal
```

### Usage
```
this.confirmModalRef.show()
  .then((result) => {
    console.log('resolve:'+JSON.stringify(result));
  })
  .catch((err) => {
    console.log('reject:'+JSON.stringify(err));
  });
```

For more details, check out the API below.

### Component API

`<ConfirmPromiseModal>` component:

Property | Type | Default | Required | Description
-------- | ---- | ------- | -------- |-----------
modalId | `String` | n/a | yes | Unique id for modal
labelId | `String` | n/a | yes | Unique id for modal title
render | `Function` | n/a | yes | Main message on modal
onRef | `Function` | n/a | yes | Used to mount for parent usage
yesButton | `String` | 'Confirm' | no | Text on confirm button
noButton | `String` | 'Cancel' | no | Text on cancel button
showTextArea | `Boolean` | false | no | Show textarea input
title | `String` | 'Notice' | no | Title on modal

Render prop example (String or Component):
```
render={typeof this.state.modalMsg === 'string' ? () => <span>{this.state.modalMsg}</span> : () => this.state.modalMsg}
```

### Note
Bootstrap 4 uses possibly will have to hard code any modal styling differences.

### Support or Contact

Any questions? Check out our [documentation](https://github.com/CalabashLabsLLC/react-simple-promise-modal/blob/master/README.md) or [contact support](https://www.calabashlabs.com/contact) and we’ll help you sort it out.

### License

MIT © [calabashlabsllc](https://github.com/calabashlabsllc)

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