All Projects → academia-de-codigo → React Semantic Toasts

academia-de-codigo / React Semantic Toasts

Licence: mit
React Semantic UI notifications library

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Semantic Toasts

Notify Py
💬 | A simple Python Module for sending cross-platform desktop notifications on Windows, macOS and Linux
Stars: ✭ 68 (-15%)
Mutual labels:  notifications
Notti
Dead simple user notification.
Stars: ✭ 72 (-10%)
Mutual labels:  notifications
Homebridge Unifi Protect Camera Motion
Camera & Motion sensor support for Unifi Protect cameras in Homekit via Homebridge
Stars: ✭ 79 (-1.25%)
Mutual labels:  notifications
Kju
Kju — Improved waiting time for the adidas.com splash page ❯❯❯_
Stars: ✭ 68 (-15%)
Mutual labels:  notifications
Qy Wechat Notification Plugin
企业微信Jenkins构建通知插件
Stars: ✭ 72 (-10%)
Mutual labels:  notifications
Soundswitch
C# application to switch default playing device. Download: https://soundswitch.aaflalo.me/
Stars: ✭ 1,190 (+1387.5%)
Mutual labels:  notifications
Calendarnotification
Android app extending calendar notifications with snooze button and notifications persistence
Stars: ✭ 67 (-16.25%)
Mutual labels:  notifications
Web Push Php
Web Push library for PHP
Stars: ✭ 1,224 (+1430%)
Mutual labels:  notifications
Crypto Coin Alerts
An application that let you set alerts for the prices of several cryptocurrencies
Stars: ✭ 72 (-10%)
Mutual labels:  notifications
Playlistcore
Media Playlist Service With Notification and Remote View Support
Stars: ✭ 77 (-3.75%)
Mutual labels:  notifications
Checknewappversionavailable
It makes a request to Play Store to check if there is a new version of your published app
Stars: ✭ 69 (-13.75%)
Mutual labels:  notifications
Typednotifications
A mechanism for sending typed notifications with payloads across your iOS app.
Stars: ✭ 70 (-12.5%)
Mutual labels:  notifications
Applozic Web Plugin
Javascript (jQuery) Real Time Chat & Messaging plugin
Stars: ✭ 76 (-5%)
Mutual labels:  notifications
Reapop
📮 A simple and customizable React notifications system
Stars: ✭ 1,155 (+1343.75%)
Mutual labels:  notifications
Sharexin
ShareX for Linux and BSD
Stars: ✭ 79 (-1.25%)
Mutual labels:  notifications
Notifier
Notifications library made with VanillaJS.
Stars: ✭ 67 (-16.25%)
Mutual labels:  notifications
Autonomie
"Autonomie" is a highly semantic, responsive, accessible and search engine optimized WordPress Theme. It provides HTML5 templates refined with microformats, microformats v2 and microdata (Schema.org). "Autonomie" supports a lot of OpenWeb plugins and is fully IndieWeb compatible.
Stars: ✭ 73 (-8.75%)
Mutual labels:  semantic
Cube slam wu
Cube SLAM 个人注释版
Stars: ✭ 78 (-2.5%)
Mutual labels:  semantic
Laravel Console Logger
Logging and Notifications for Laravel Console Commands.
Stars: ✭ 79 (-1.25%)
Mutual labels:  notifications
Notify
Cross-platform library for desktop notifications for your go application
Stars: ✭ 76 (-5%)
Mutual labels:  notifications

React Semantic Toasts

Simple and easy Semantic UI animated toast notifications for React

Toasts

Installation

$ npm install --save react-semantic-toasts semantic-ui-react semantic-ui-css

Usage

The library does not depend on semantic-ui-css anymore, make sure to import semantic.min.css or at the very least, to include the following components:

import 'semantic-ui-css/components/reset.min.css';
import 'semantic-ui-css/components/site.min.css';
import 'semantic-ui-css/components/container.min.css';
import 'semantic-ui-css/components/icon.min.css';
import 'semantic-ui-css/components/message.min.css';
import 'semantic-ui-css/components/header.min.css';

Import the library into your project using ES6 module syntax:

import { SemanticToastContainer, toast } from 'react-semantic-toasts';
import 'react-semantic-toasts/styles/react-semantic-alert.css';

Render the SemanticToastContainer component:

render() {
    return <SemanticToastContainer />;
}

Fire as many notifications as you want

setTimeout(() => {
    toast(
        {
            title: 'Info Toast',
            description: <p>This is a Semantic UI toast</p>
        },
        () => console.log('toast closed'),
        () => console.log('toast clicked'),
        () => console.log('toast dismissed')
    );
}, 1000);

setTimeout(() => {
    toast({
        type: 'warning',
        icon: 'envelope',
        title: 'Warning Toast',
        description: 'This is a Semantic UI toast wich waits 5 seconds before closing',
        animation: 'bounce',
        time: 5000,
        onClose: () => alert('you close this toast'),
        onClick: () => alert('you click on the toast'),
        onDismiss: () => alert('you have dismissed this toast')
    });
}, 5000);

API

Toast Container

The <SemanticToastContainer> receives an optional position prop, which can be one of top-right, top-center, top-left, bottom-right, bottom-center or bottom-left.

The type of animation can be specifed using an optional animation prop with any supported SemanticUI animation value. If not present, will be derived from the container position.

<SemanticToastContainer position="top-right" />

Toast

The toast notification function receives a toast options object and optional close, click and dismiss callbacks as function arguments:

toast(options, onClose, onClick, onDismiss);

Toast Options

  • title - The header of the toast
  • description - The content of the toast
  • type - Can be one of info, success, warning, or error
  • icon - Override the default icon
  • color - Override color with semantic values
  • size - Size of toast with semantic values
  • list - Array of strings for showing an item menu inside the toast
  • time - Duration to keep the toast open, 0 to wait until closed by the user
  • onClose - The function that will be called when the toast is closed (either if you have clicked the close sign or if the toast has been closed after time has passed)
  • onClick - The function that will be called when you click on the toast
  • onDismiss - The function that will be called when you click to close the toast. onClose function will be called afterwards.
  • animation - Override the default toast container animation

License

Licensed under MIT

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].