All Projects → Cogoport → Cogo Toast

Cogoport / Cogo Toast

Licence: mit
Beautiful, Zero Configuration, Toast Messages for React. Only ~ 4kb gzip, with styles and icons

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Cogo Toast

Overlay support
a flutter toast and notification library
Stars: ✭ 232 (-58.35%)
Mutual labels:  notifications, toast
Toastnotifications
Toast notifications for WPF allows you to create and display rich notifications in WPF applications. It's highly configurable with set of built-in options like positions, behaviours, themes and many others. It's extendable, it gives you possibility to create custom and interactive notifications in simply manner.
Stars: ✭ 507 (-8.98%)
Mutual labels:  notifications, messages
Toasted Notes
simple, flexible toast notifications for react
Stars: ✭ 241 (-56.73%)
Mutual labels:  notifications, toast
Angular Notifier
A well designed, fully animated, highly customizable, and easy-to-use notification library for your Angular application.
Stars: ✭ 175 (-68.58%)
Mutual labels:  notifications, toast
php-flasher
🔔 Flasher is a powerful and flexible flash notifications system for PHP, Laravel, Symfony
Stars: ✭ 68 (-87.79%)
Mutual labels:  notifications, toast
React Notify Toast
Toast notifications for React.js
Stars: ✭ 176 (-68.4%)
Mutual labels:  notifications, toast
Sentinel
👀 Native notifications for League of Legends
Stars: ✭ 38 (-93.18%)
Mutual labels:  notifications, toast
Notyf
👻 A minimalistic, responsive, vanilla JavaScript library to show toast notifications.
Stars: ✭ 2,093 (+275.76%)
Mutual labels:  notifications, toast
ngx-toasta
Simple and clean Toast notification library for AngularX (Angular2 and beyond)
Stars: ✭ 20 (-96.41%)
Mutual labels:  notifications, toast
tall-toasts
A Toast notification library for the Laravel TALL stack. You can push notifications from the backend or frontend to render customizable toasts with almost zero footprint on the published CSS/JS 🔥🚀
Stars: ✭ 296 (-46.86%)
Mutual labels:  notifications, toast
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 (-69.12%)
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 (-47.58%)
Mutual labels:  notifications, toast
React Toast Notifications
🍞 A toast notification system for react
Stars: ✭ 2,103 (+277.56%)
Mutual labels:  notifications, toast
Sweetalert2
A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies.
Stars: ✭ 13,929 (+2400.72%)
Mutual labels:  notifications, toast
Notistack
Highly customizable notification snackbars (toasts) that can be stacked on top of each other
Stars: ✭ 2,562 (+359.96%)
Mutual labels:  notifications, toast
vue-dk-toast
Lightweight toast-notification plugin for Vue 3 🍞
Stars: ✭ 23 (-95.87%)
Mutual labels:  notifications, toast
Mini Toastr
Small non-blocking notification library. No dependencies
Stars: ✭ 94 (-83.12%)
Mutual labels:  notifications, messages
Svelte Notifications
Svelte toast notifications component that can be used in any JS application
Stars: ✭ 146 (-73.79%)
Mutual labels:  notifications, toast
SteamAchievementNotifier
Steam Achievement Notifier is an Electron application that shows a customisable notification when you unlock any Steam Achievement! It uses the Steam Web API to track achievement stats in real time, and displays an achievement summary within the notification.
Stars: ✭ 77 (-86.18%)
Mutual labels:  notifications, toast
Razor.SweetAlert2
A Razor class library for interacting with SweetAlert2
Stars: ✭ 98 (-82.41%)
Mutual labels:  notifications, toast

cogo-toast

Cogo Toast

Beautiful, Zero Configuration, Toast Messages for React ~4kb gzip (with styles and icons)

https://cogoport.github.io/cogo-toast/

Dependencies npm package Small size npm downloads Code style License

cogo-toast-preview

Install via NPM:

npm install --save cogo-toast

Install via Yarn:

yarn add cogo-toast

Note:

The latest version ^3.0.0 makes the use of React Hooks internally.

To use this package in projects that don't support hooks, use v2.0.1 instead.

yarn add [email protected]

Usage

Its Plug and Play. No configuration required. Just import and you are good to go.

import cogoToast from 'cogo-toast';

cogoToast.success('This is a success message!');

5 Built in Types

There are 5 built-in types to handle the most common cases in any application.

cogoToast.success('This is a success message');

cogoToast.info('This is a info message');

cogoToast.loading('This is a loading message');

cogoToast.warn('This is a warn message');

cogoToast.error('This is a error message');

Use JSX

cogoToast is built using React. Which means any valid jsx can be used as the message in cogoToast

cogoToast.info(
  <div>
    <b>Awesome!</b>
    <div>Isn't it?</div>
  </div>,
);

Returns a Promise

Returns a promise which resolves when the toast is about to hide.

This can be useful to do some action when the toast has completed showing.

cogoToast.loading('Loading your data...').then(() => {
  cogoToast.success('Data Successfully Loaded');
});

Hide on Click

const { hide } = cogoToast.success('This is a success message.', {
  onClick: () => {
    hide();
  },
});

Completely Customizable

The second parameter to the function is an options object that can be passed in for customization.

cogoToast.info('This is an info message', options);

All Available Options

Here's a list of all the available options, to customize the toast to your needs.

Options Type Default
hideAfter Number in Seconds 3
(Can be 0 to disable auto-hiding of the toast)
position 'top-left', 'top-center', 'top-right',
'bottom-left', 'bottom-center', 'bottom-right'
'top-center'
heading String ''
renderIcon Function Icon Based on the Type
bar Object
{ size: '2px', style: 'solid/dashed/dotted', color: '#hex' }
Based on the Type
onClick() Function null
role aria-role status
toastContainerID The dom element in which the toast container is added ct-container

Custom Styling

You can provide your own custom styling by extending the ct-toast class in your css styles.

For all classnames, refer to /src/styles/styles.css

Customize each type of Toast seperately

Customize each type of Toast seperately, by extending the ct-toast-<type> class. For example, in your CSS,

ct-toast-success {
  color: #FFFFFF;
  background: #6EC05F;
}

Only ~ 4kb gzip (with Styles and Icons)

The package contains the minified build file, along with the SVG Icons and the Styles, built into the Code, with a total of only ~4kb gzip.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Anmol Mahatpurkar
Anmol Mahatpurkar

💻 🎨 📖
Balázs Orbán
Balázs Orbán

💻
Vitalii Kalchuk
Vitalii Kalchuk

💻
Amar Pathak
Amar Pathak

📖
Nataly Shrits
Nataly Shrits

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

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