An open API service indexing awesome lists of open source software.

https://github.com/chrispenner/wisp-react-redux

A Toast/Notification Library that integrates seamlessly with React and Redux.
https://github.com/chrispenner/wisp-react-redux

Last synced: about 2 months ago
JSON representation

A Toast/Notification Library that integrates seamlessly with React and Redux.

Awesome Lists containing this project

README

        

# Wisp
A Toast/Notification Library that integrates seamlessly with React and Redux.

Success:
![Success](images/success.png)

Failure:
![Error](images/error.png)

## What is it
It's a toast-style notification system that works well with the rest of your react-redux app.
You display notifications by dispatching actions.

## Setup
Wisp requires the following dependencies to be installed:

- `react`
- `react-redux`
- `react-addons-css-transition-group`

Add the `Wisps` component to your app so it's rendered on every page (the actual location in the page doesn't matter).

```javascript
import { Wisps } from 'wisp-react-redux'
const App = () => {
return (


...Rest of the app


)
}
```

Add the `wispReducer` to your app's root reducer under the `wisps` key.

```javascript
import { wispReducer } from 'wisp-react-redux'
import { combineReducers } from 'redux'
export default combineReducers({
wisps: wispReducer,
/*...other reducers */
})
```

Also ensure that the

Now you can trigger notifications by dispatching actions! There are some action creators built in:

- successWisp
- errorWisp
- wisp

These take an options object as their only parameter:

```javascript
{
[optional] title,
[optional] message,
[optional] customClass,
}
```

For example:

```javascript
successWisp({title: "Success!", message: "Document Saved"})
```

## Customization
You can customize the styling of your notifications by passing specific configuration props.

- `customClass`: