# react-dialogs

> React Dialog Component

Latest version **1.0.0** (published 2016-11-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-dialogs
pnpm add react-dialogs
yarn add react-dialogs
bun add react-dialogs
```

## 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.0 |
| Published | 2016-11-10 |
| First published | 2016-11-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Huy T. |
| Maintainers | huytbt |
| Keywords | react, dialog, js, javascript, component, es6, babel |

## Links

- npm: https://www.npmjs.com/package/react-dialogs
- Repository: https://github.com/huytbt/react-dialog
- Homepage: https://github.com/huytbt/react-dialog#readme
- Issues: https://github.com/huytbt/react-dialog/issues
- npm.io page: https://npm.io/package/react-dialogs

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^15.3.2
- [react-dom](https://npm.io/package/react-dom.md) ^15.3.2
- [react-bootstrap](https://npm.io/package/react-bootstrap.md) ^0.30.6

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-11-10

## README

# React Dialog Component

[![Build Status](https://travis-ci.org/huytbt/react-dialog.svg?branch=master)](https://travis-ci.org/huytbt/react-dialog)
[![License](https://img.shields.io/github/license/huytbt/react-dialog.svg)](https://github.com/huytbt/react-dialog/master/LICENSE)

## Installation

```bash
npm install react-dialogs --save
```

## Usage

```js
import React, {Component} from 'react';
import {MsgBox} from 'react-dialogs';

class App extends Component {
  showAlert() {
    this.refs.msgbox.alert('Good luck to you!', 'Information');
  }

  showConfirm() {
    this.refs.msgbox.confirm('Are you sure to delete this?', 'Need Confirm', (confirm) => {
      alert(confirm ? 'You choose OK' : 'You choose Cancel');
    });
  }

  render() {
    return (
      <div>
        <p>
          <button onClick={this.showAlert.bind(this)}>Show alert</button>
        </p>
        <p>
          <button onClick={this.showConfirm.bind(this)}>Show confirm</button>
          {this.state.message}
        </p>
        <MsgBox ref="msgbox"/>
      </div>
    );
  }
}
```

You need add bootstrap css. Example use CDN

```html
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
```

## Props

Property|Type|Default|Description
---|---|---|---
okText|string|'OK'|Text of OK button
okStyle|string|'primary'|Style of OK button. Other values: success, info, warning, danger, link
cancelText|string|'Cancel'|Text of Cancel button
cancelStyle|string|'primary'|Style of Cancel button. Other values: success, info, warning, danger, link

## Developement

```bash
# Clone code
git clone https://github.com/huytbt/react-dialog.git

cd react-dialog

# Install packages
npm install

# Start dev server
npm start

# Testing
npm test

# Build
npm run build
```

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