# react-simple-alert

> A simple alert component for React

Latest version **0.0.2** (published 2015-06-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-simple-alert
pnpm add react-simple-alert
yarn add react-simple-alert
bun add react-simple-alert
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2015-06-11 |
| First published | 2015-06-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Cherie Liu |
| Maintainers | cheriejiajia |
| Keywords | react, react-component, alert |

## Links

- npm: https://www.npmjs.com/package/react-simple-alert
- Repository: https://github.com/cheriejiajia/react-simple-alert
- Issues: https://github.com/cheriejiajia/react-simple-alert/issues
- npm.io page: https://npm.io/package/react-simple-alert

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

- 0.0.2 (latest) — 2015-06-11
- 0.0.1 — 2015-06-11

## README

# react-simple-alert
A simple alert component for React

##How to use:

"options" props is required.
Set options for the component:
- title: The text displayed as title in the header.
- message: The text displayed as main content in the body.
- alert: Indicates if the alert is displayed or not.
- confirmButton (optional): Define the button with functionality in the footer. If this is defined, a "Cancel" button will be added automatically. If not, a default "Close" button will be displayed instead.

```js
var React = require('react');
var ReactSimpleAlert = require('react-simple-alert');

var App = React.createClass({
	getInitialState: function() {
		return {
			alert: false 
		};
	},
	render: function() {
		var rsaOptions = {
			title: "Alert title",
			message: "This is an alert!",
			alert: this.state.alert,
			confirmButton: {
				text: "Save", 
				action: function(){
					//Click action for the "Save" button
				}
			}
		};
		return (
			<div>
				<button onClick={this._alert}>alert</button>
				<ReactSimpleAlert options={rsaOptions} />
			</div>
		);
	},

	_alert: function(){
		this.setState({alert: true});
	}
});
```

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