All Projects → ngneat → Hot Toast

ngneat / Hot Toast

Licence: mit
🍞 Smoking hot Notifications for Angular. Lightweight, customizable and beautiful by default.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Hot Toast

Vuetify Toast Snackbar
Basic Vue toast service that uses Vuetify Snackbar component.
Stars: ✭ 123 (-62.5%)
Mutual labels:  toast, snackbar
Flash
⚡️A highly customizable, powerful and easy-to-use alerting library for Flutter.
Stars: ✭ 174 (-46.95%)
Mutual labels:  toast, snackbar
Noty
A simple library for creating animated warnings/dialogs/alerts for Android.
Stars: ✭ 136 (-58.54%)
Mutual labels:  toast, snackbar
Androidutilcode
AndroidUtilCode 🔥 is a powerful & easy to use library for Android. This library encapsulates the functions that commonly used in Android development which have complete demo and unit test. By using it's encapsulated APIs, you can greatly improve the development efficiency. The program mainly consists of two modules which is utilcode, which is commonly used in development, and subutil which is rarely used in development, but the utils can be beneficial to simplify the main module. 🔥
Stars: ✭ 30,239 (+9119.21%)
Mutual labels:  toast, snackbar
mosha-vue-toastify
A light weight and fun Vue 3 toast or notification or snack bar or however you wanna call it library.
Stars: ✭ 185 (-43.6%)
Mutual labels:  toast, snackbar
Android Appmsg
In-layout notifications. Based on Toast notifications and article by Cyril Mottier (http://android.cyrilmottier.com/?p=773).
Stars: ✭ 1,384 (+321.95%)
Mutual labels:  toast, snackbar
React Toast Notifications
🍞 A toast notification system for react
Stars: ✭ 2,103 (+541.16%)
Mutual labels:  toast, snackbar
Cookiebar
CookieBar is a lightweight library for showing a brief message at the top or bottom of the screen.
Stars: ✭ 497 (+51.52%)
Mutual labels:  toast, snackbar
AckBar
AckBar is a very lightweight and customizable android library to display brief message to user.
Stars: ✭ 14 (-95.73%)
Mutual labels:  toast, snackbar
Snackbar
A tiny browser library for showing a brief message at the bottom of the screen (1kB gzipped).
Stars: ✭ 224 (-31.71%)
Mutual labels:  toast, snackbar
Sneaker
A lightweight Android library for customizable alerts
Stars: ✭ 928 (+182.93%)
Mutual labels:  toast, snackbar
denbun
Adjust showing frequency of Android app messages, and to be more user friendly 🐦
Stars: ✭ 17 (-94.82%)
Mutual labels:  toast, snackbar
React Toastify
React notification made easy 🚀 !
Stars: ✭ 8,113 (+2373.48%)
Mutual labels:  toast, snackbar
Livesmashbar
An elegant looking and easy to use informative library with LiveData integration for Android.
Stars: ✭ 107 (-67.38%)
Mutual labels:  toast, snackbar
Devutils
🔥 ( 持续更新,目前含 160+ 工具类 ) DevUtils 是一个 Android 工具库,主要根据不同功能模块,封装快捷使用的工具类及 API 方法调用。该项目尽可能的便于开发人员,快捷、高效开发安全可靠的项目。
Stars: ✭ 680 (+107.32%)
Mutual labels:  toast, snackbar
Notistack
Highly customizable notification snackbars (toasts) that can be stacked on top of each other
Stars: ✭ 2,562 (+681.1%)
Mutual labels:  toast, snackbar
Smart Show
Toast & Snackbar & TopBar & Dialog
Stars: ✭ 430 (+31.1%)
Mutual labels:  toast, snackbar
React Native Smart Tip
🔥🔥🔥Toast , SnackBar , Modal , Show Toast above Modal
Stars: ✭ 198 (-39.63%)
Mutual labels:  toast, snackbar
bs5-utils
A JavaScript utility package for Bootstrap 5 components.
Stars: ✭ 26 (-92.07%)
Mutual labels:  toast, snackbar
smart-show
Toast # Snackbar # Dialog
Stars: ✭ 500 (+52.44%)
Mutual labels:  toast, snackbar


npm MIT commitizen PRs styled with prettier styled with prettier All Contributors ngneat cypress semantic-release

Smoking hot Notifications for Angular. Lightweight, customizable and beautiful by default. Inspired from react-hot-toast

Features

  • 🔥 Hot by default
  • Easy to use
  • 🐍 Snackbar variation
  • Accessible
  • 🖐️ Reduce motion support
  • 😊 Emoji Support
  • 🛠 Customizable
  • Observable API
  • Pause on hover
  • 🔁 Events
  • 🔒 Persistent

Installation

You can install it through Angular CLI:

ng add @ngneat/hot-toast

or with npm:

npm install @ngneat/overview @ngneat/hot-toast

When you install using npm or yarn, you will also need to import HotToastModule in your app.module. You can also set global toast options (Partial<ToastConfig>) here.:

import { HotToastModule } from '@ngneat/hot-toast';

@NgModule({
  imports: [HotToastModule.forRoot()],
})
class AppModule {}

Basic Usage

import { HotToastService } from '@ngneat/hot-toast';

@Component({})
export class AppComponent {
  constructor(private toast: HotToastService) {}

  showToast() {
    this.toast.show('Hello World!');
    this.toast.loading('Lazyyy...');
    this.toast.success('Yeah!!');
    this.toast.warning('Boo!');
    this.toast.error('Oh no!');
  }

  update() {
    saveSettings.pipe(
      this.toast.observe(
        {
          loading: 'Saving...',
          success: 'Settings saved!',
          error: 'Could not save.',
        }
      )
    ).subscribe();
  }
}

You can pass ToastOptions while creating the toast to customize the look and behavior:

import { HotToastService } from '@ngneat/hot-toast';

@Component({})
export class AppComponent {
  constructor(private toast: HotToastService) {}

  customToast() {
    this.toast.success('Look at my styles, and I also need more time!', {
      duration: 5000,
      style: {
        border: '1px solid #713200',
        padding: '16px',
        color: '#713200',
      },
      iconTheme: {
        primary: '#713200',
        secondary: '#FFFAEE',
      },
    });
  }
}

You can also set global ToastConfig options while importing:

import { HotToastModule } from '@ngneat/hot-toast';

@NgModule({
  imports: [HotToastModule.forRoot({
    reverseOrder: true,
    dismissible: true,
    autoClose: false
  })],
})
class AppModule {}

Examples

You can checkout examples at: https://ngneat.github.io/hot-toast#examples.

ToastConfig

All options, which are set Available in global config? from ToastOptions are supported. Below are extra configurable options:

Name Type Description
reverseOrder boolean Sets the reverse order for hot-toast stacking
Default: false

ToastOptions

Configuration used when opening an hot-toast.

Name Type Description Available in global config?
id string Unique id to associate with hot-toast. There can't be multiple hot-toasts opened with same id.
Example
No
duration number Duration in milliseconds after which hot-toast will be auto closed. Can be disabled via autoClose: false
Default: 3000, error = 4000, loading = 30000
Yes
autoClose boolean Auto close hot-toast after duration
Default: true
Yes
position ToastPosition The position to place the hot-toast.
Default: top-center
Example
Yes
dismissible boolean Show close button in hot-toast
Default: false
Example
Yes
role ToastRole Role of the live region.
Default: status
Yes
ariaLive ToastAriaLive aria-live value for the live region.
Default: polite
Yes
theme ToastTheme Visual appearance of hot-toast
Default: toast
Example
Yes
persist {ToastPersistConfig} Useful when you want to keep a persistance for toast based on ids, across sessions.
Example
No
icon Content Icon to show in the hot-toast
Example
Yes
iconTheme IconTheme Use this to change icon color
Example
Yes
className string Extra CSS classes to be added to the hot toast container. Yes
style style object Extra styles to apply for hot-toast.
Example
Yes
closeStyle style object Extra styles to apply for close button Yes
data DataType Allows you to pass data for your template and component. You can access the data using toastRef.data.
Examples: Template with Data, Component with Data
No
injector Injector Allows you to pass injector for your component.
Example
No

Supported Browsers

Latest versions of Chrome, Edge, Firefox and Safari are supported, with some known issues.

Accessibility

Hot-toast messages are announced via an aria-live region. By default, the polite setting is used. While polite is recommended, this can be customized by setting the ariaLive property of the ToastConfig or ToastOptions.

Focus is not, and should not be, moved to the hot-toast element. Moving the focus would be disruptive to a user in the middle of a workflow. It is recommended that, for any action offered in the hot-toast, the application offers the user an alternative way to perform the action. Alternative interactions are typically keyboard shortcuts or menu options. When the action is performed in this way, the hot-toast should be dismissed.

Hot-toasts that have an action available should be set autoClose: false, as to accommodate screen-reader users that want to navigate to the hot-toast element to activate the action.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Dharmen Shah

💻 🖋 🎨 📖 💡

Netanel Basal

🐛 💼 🤔 🚧 🧑‍🏫 📆 🔬 👀

Timo Lins

🎨 🤔

Patrick Miller

🚧 📦

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

Icons made by Freepik from www.flaticon.com
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].