react-notification
![Dependency Status](https://david-dm.org/pburtchaell/react-classes.svg)
Overview
This is a component designed to provide "snackbar" notification messages.
Warning: this is a major version zero release. The component is still under development and the API may change at any time. Please report issues and bugs on GitHub.
Getting Started
- First, install the component via npm:
npm install react-notification
- Require the component:
var Notification = require('react-notification');
Usage
<Notfication
message={string}
action={string}
onClick={func}
/>
Props
Name | Type | Description |
---|
message | string | The message for the notification |
action | string | The name of the action, e.g., "close" or "undo" |
Methods
Method | Usage | |
---|
show | Notification.show() | Opens the notification. |
hide | Notification.hide() | Hides the notifciation. |
Events
Event | Description |
---|
onClick | Fuction runs on change |
DOM Nodes
As this component does not include CSS styles to use, you will need to add your own styles. The DOM tree of the component is included below for reference.
<div class="notficiation-bar">
<div class="notfication-bar-wrapper" onClick={this.props.onClick}>
<span class="notfication-bar-message">{this.props.message}</span>
<span class="notification-bar-action">{this.props.action}</span>
</div>
</div>
Built with care in New Orleans by Patrick Burtchaell.
Copyright 2014 Patrick Burtchaell. Licensed MIT.