All Projects → LouisBarranqueiro → Reapop

LouisBarranqueiro / Reapop

Licence: mit
📮 A simple and customizable React notifications system

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Reapop

Notie
🔔 a clean and simple notification, input, and selection suite for javascript, with no dependencies
Stars: ✭ 6,170 (+434.2%)
Mutual labels:  notifications, toast, notification
Notiflix
Notiflix is a JavaScript library for client-side non-blocking notifications, popup boxes, loading indicators, and more that makes your web projects much better.
Stars: ✭ 172 (-85.11%)
Mutual labels:  notifications, toast, notification
Gsmessages
A simple style messages/notifications, in Swift.
Stars: ✭ 595 (-48.48%)
Mutual labels:  notifications, toast
Fftoast
A very powerful iOS message notifications and AlertView extensions. It can be easily realized from the top of the screen, the bottom of the screen and the middle of the screen pops up a notification. You can easily customize the pop-up View.
Stars: ✭ 649 (-43.81%)
Mutual labels:  toast, notification
Vue Snotify
Vuejs 2 Notification Center
Stars: ✭ 755 (-34.63%)
Mutual labels:  notifications, toast
Bot toast
A really easy to use flutter toast library
Stars: ✭ 551 (-52.29%)
Mutual labels:  toast, notification
Cogo Toast
Beautiful, Zero Configuration, Toast Messages for React. Only ~ 4kb gzip, with styles and icons
Stars: ✭ 557 (-51.77%)
Mutual labels:  notifications, toast
Vue Toastification
Vue notifications made easy!
Stars: ✭ 747 (-35.32%)
Mutual labels:  notifications, toast
Ng Snotify
Angular 2+ Notification Center
Stars: ✭ 304 (-73.68%)
Mutual labels:  notifications, toast
Burnttoast
Module for creating and displaying Toast Notifications on Microsoft Windows 10.
Stars: ✭ 796 (-31.08%)
Mutual labels:  notifications, toast
Laravel Notify
Flexible Flash notifications for Laravel
Stars: ✭ 787 (-31.86%)
Mutual labels:  notifications, toast
React Toastify
React notification made easy 🚀 !
Stars: ✭ 8,113 (+602.42%)
Mutual labels:  toast, notification
React Cool Portal
😎 🍒 React hook for Portals, which renders modals, dropdowns, tooltips etc. to <body> or else.
Stars: ✭ 458 (-60.35%)
Mutual labels:  toast, notification
Monitor Table Change With Sqltabledependency
Get SQL Server notification on record table change
Stars: ✭ 459 (-60.26%)
Mutual labels:  notifications, notification
Toastify Js
Pure JavaScript library for better notification messages
Stars: ✭ 570 (-50.65%)
Mutual labels:  notifications, toast
Notifications
🛎 Notifications Center engine like GitHub or other application for any Rails applications.
Stars: ✭ 359 (-68.92%)
Mutual labels:  notifications, notification
Anylayer
Android稳定高效的浮层创建管理框架
Stars: ✭ 745 (-35.5%)
Mutual labels:  toast, notification
Razor.SweetAlert2
A Razor class library for interacting with SweetAlert2
Stars: ✭ 98 (-91.52%)
Mutual labels:  notifications, toast
Ftindicator
A light wight UI package contains local notification, progress HUD, toast, with blur effect, elegant API and themes support.
Stars: ✭ 292 (-74.72%)
Mutual labels:  notifications, toast
Yii2 Slack Log
Pretty Slack log target for Yii 2
Stars: ✭ 24 (-97.92%)
Mutual labels:  notifications, notification

Reapop

npm version npm download/month coveralls status

A simple and customizable React notifications system

Summary

Compatibility

Supported browsers

IE / EdgeIE / Edge FirefoxFirefox ChromeChrome SafariSafari OperaOpera
IE10, IE11, Edge last 2 versions last 2 versions last 2 versions last 2 versions

Demo

Check out the demo.

Installation

npm install reapop --save

Integration & usage

With React and Redux

1 - Add the notifications reducer to your Redux store.

import {combineReducers, createStore} from 'redux'
import {reducer as notificationsReducer} from 'reapop'

const rootReducer = combineReducers({
    notifications: notificationsReducer(),
    ... your other reducers
})
const store = createStore(rootReducer)

2 - Add the NotificationsSystem component to your app. Place this component at the root of your application to avoid position conflicts.

import React from 'react'
import {useDispatch, useSelector} from 'react-redux'
import NotificationsSystem, {atalhoTheme, dismissNotification} from 'reapop'

const ATopLevelComponent = () => {
    const dispatch = useDispatch();
    // 1. Retrieve the notifications to display.
    const notifications = useSelector((state) => state.notifications)
    
    return (
        <div>
            <NotificationsSystem
                // 2. Pass the notifications you want Reapop to display.
                notifications={notifications}
                // 3. Pass the function used to dismiss a notification.
                dismissNotification={(id) => dispatch(dismissNotification(id))}
                // 4. Pass a builtIn theme or a custom theme.
                theme={atalhoTheme}
            />
        </div>
    )
}

3 - Upsert or dismiss notification from any React components.

import React from 'react'
import {useDispatch} from 'react-redux'
// 1. Retrieve the action to create/update a notification, or any other actions.
import {notify} from 'reapop'

const AComponent = () => {
    // 2. Retrieve the function to dispatch an action.
    const dispatch = useDispatch() 
    useEffect(() => {
        // 3. Create a notification.
        dispatch(notify('Welcome to the documentation', 'info'))
    }, [])

    return (
        ...
    )
}

4 - Upsert or dismiss notification from Redux actions.

// 1. Retrieve the action to create/update a notification.
import {notify} from 'reapop'

const sendResetPasswordLink = () => (dispatch) => {
    axios.post('https://api.example.com/users/ask-reset-password')
        // 2. Create a notification.
        .then((resp) => dispatch(notify(resp.data.detail, 'success'))
        .catch((resp) => dispatch(notify(resp.data.detail, 'error'))
    }
}

With React alone (react >= 16.8.0)

1 - Add the NotificationsProvider at the root of your application. It is important that this component wraps all the components where you want to access the notifications and the actions to manipule notifications.

import React from 'react'
import {NotificationsProvider} from 'reapop'

const ARootComponent = () => {
    return (
        <NotificationsProvider>
            // ... components
        </NotificationsProvider>
    )
}

2 - Add the NotificationsSystem component to your app. Place this component at the root of your application to avoid position conflicts.

import React from 'react'
import NotificationsSystem, {atalhoTheme, useNotifications} from 'reapop'

const ATopLevelComponent = () => {
    // 1. Retrieve the notifications to display, and the function used to dismiss a notification.
    const {notifications, dismissNotification} = useNotifications()
    return (
        <div>
            <NotificationsSystem
                // 2. Pass the notifications you want Reapop to display.
                notifications={notifications}
                // 3. Pass the function used to dismiss a notification.
                dismissNotification={(id) => dismissNotification(id)}
                // 4. Pass a builtIn theme or a custom theme.
                theme={atalhoTheme}
            />
        </div>
    )
}

3 - Upsert or dismiss notification from any React components.

import React from 'react'
import {useNotifications} from 'reapop'

const AComponent = () => {
    // 1. Retrieve the action to create/update a notification.
    const {notify} = useNotifications()
    
    useEffect(() => {
        // 2. Create a notification.
        notify('Welcome to the documentation', 'info')
    }, [])

    return (
        ...
    )
}

Documentation

Read the documentation to learn more and see what you can with it.

License

Reapop is under MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].