# react-popup-master

> Simple and powerful react popup component. Confirm, loading, progress, notify and so on

Latest version **1.0.1** (published 2017-08-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-popup-master
pnpm add react-popup-master
yarn add react-popup-master
bun add react-popup-master
```

## 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.1 |
| Published | 2017-08-16 |
| First published | 2017-08-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | xiezhanggen@gmail.com |
| Maintainers | jaycie |
| Keywords | popup, toast |

## Links

- npm: https://www.npmjs.com/package/react-popup-master
- Repository: https://github.com/jaycie/react-popup
- Homepage: https://github.com/jaycie/react-popup#readme
- Issues: https://github.com/jaycie/react-popup/issues
- npm.io page: https://npm.io/package/react-popup-master

## Dependencies (1)

- [react-addons-css-transition-group](https://npm.io/package/react-addons-css-transition-group.md) ^15.6.0

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-08-16
- 1.0.0 — 2017-08-15

## README

# react-popup
Simple and powerful react popup component. Confirm, loading, progress, notify and so on  

# Usage

## install
```javascript
npm install react-popup-master --save
```
## code
```javascript
import React, { Component } from 'react';
import Popup , { P } from 'react-popup-master';

export default class PopupDemo extends Component {
  render() {
    return (
      <div>
            <Popup />
            <h1>Popup Demo</h1>
            <p>
                <button onClick={()=>{
                    P.confirm({
                        title: 'Title',
                        message: 'Hi brother, give me a star, please!',
                        option: [{
                            text: '点赞',
                            fn: () => {
                                alert('很赞')
                            }
                        }, {
                            text: '残忍拒绝',
                            fn: () => {
                                alert('太残忍')
                            }
                        }, {
                            text: '取消',
                        }]
                    });
                }}> 确认多按钮(confirm)</button>
            </p>
                

            <p>
                <button onClick={()=>{
                    P.confirm({
                        title: 'Title',
                        message: 'long message long message long message long message long message long message long message long message long message long message long message ',
                        option: [{
                            text: '确定',
                            fn: () => {
                                alert(124)
                            }
                        }, {
                            text: '取消',
                        }]
                    });
                }}> 确认长消息(confirm)</button>
            </p>

            <p>
                <button onClick={()=>{
                    P.loading('加载中')
                    setTimeout(P.loaded,2000)
                }}>加载中(loading)</button>
            </p>

            <p>
                <button onClick={()=>{
                    P.progress.start('图片上传中')
                    let i = 0.1;
                    let interval = setInterval(()=>{
                        i+=0.1*Math.random();
                        if (i>=1) {
                            clearInterval(interval);
                            i=1;
                            P.progress.done('上传完成!');
                            return;
                        };
                        P.progress.set(i)
                    },200)

                }}>进度条(progress)</button>
            </p>

            <p>
                <button onClick={()=>{
                    P.notify('密码错误')
                }}>提示(notify)</button>
            </p>
        </div>
    );
  }
}
```
    
## Demo
<img src="https://raw.githubusercontent.com/jaycie/react-popup/master/screenshots/confirm.png" width = "400" height = "auto" alt="confirm"/>
<img src="https://raw.githubusercontent.com/jaycie/react-popup/master/screenshots/confirm2.png" width = "400" height = "auto" alt="confirm2"/>
<img src="https://raw.githubusercontent.com/jaycie/react-popup/master/screenshots/loading.png" width = "400" height = "auto" alt="loading"/>
<img src="https://raw.githubusercontent.com/jaycie/react-popup/master/screenshots/progress.png" width = "400" height = "auto" alt="progress"/>
<img src="https://raw.githubusercontent.com/jaycie/react-popup/master/screenshots/notify.png" width = "400" height = "auto" alt="notify"/>


### Props 
- 'components': Custom middle context component

### Methods
Method            |  Description
----------------- |  -----------
`confirm()`       |  confirm  dialogs   
`loading()`       |  loading dialogs
`progress()`      |  progress dialogs
`notify()`        |  notify dialogs

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