1.0.6 • Published 7 years ago

react-message-box v1.0.6

Weekly downloads
48
License
ISC
Repository
github
Last release
7 years ago

react-message-box

npm version Build Status

React message box widget.

Install

npm install react-message-box --save

example

import React from 'react'
import { render } from 'react-dom'
import {Modal, Button} from 'react-bootstrap'

import MessageBox from 'react-message-box'

import 'bootstrap/dist/css/bootstrap.css'

class App extends React.Component {
	showAlert() {
		this.refs.messageBox.alert("Alert", "This is alert!").ok(() => {
			console.log("Alert ok!");
		});
	}

	showConfirm() {
		this.refs.messageBox.confirm("Confirm", "This is confirm!").ok(() => {
			console.log("Confirm ok!");
		}).cancle(() => {
			console.log("Confirm cancle!");
		});
	}

	render() {
		return (
			<div>
				<Button onClick={this.showAlert.bind(this)}>Alert Box</Button>
				<Button onClick={this.showConfirm.bind(this)}>Confirm Box</Button>
				<MessageBox ref="messageBox"/>
			</div>
		);
	}
}

render(
  <App />,
  document.getElementById('root')
);
1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago