Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ngneat/hot-toast

Package Overview
Dependencies
Maintainers
3
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngneat/hot-toast

Smoking hot Notifications for Angular. Lightweight, customizable and beautiful by default.

  • 1.0.0-beta.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

ngneat hot toast


MIT commitizen PRs styled with prettier All Contributors ngneat spectator

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

Features

  • 🔥 Hot by default
  • Easy to use
  • Accessible
  • 🖐️ Reduce motion support
  • 😊 Emoji Support
  • 🛠 Customizable
  • Observable API - Automatic loader from an observable
  • Pause on hover - No JavaScript, paused through CSS animation-play-state
  • 🔁 Events
  • 🔒 Persistent - Opens one toast at a time with unique id. Can be configured.

Installation

You can install it through Angular CLI:

ng add @ngneat/hot-toast

or with npm or yarn:

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

#or

yarn add @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()],
})

// ...

Basic Usage

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

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

showToast() {
  this.toast.show('Hello World!')
}

Examples

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

ToastConfig

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

NameTypeDescription
reverseOrderbooleanSets the reverse order for hot-toast stacking
Default: false
windowRefWindow & typeof globalThisSets the window, from which document will be fetched and hot-toasts will be added to there.
Default: window

ToastOptions

Configuration used when opening an hot-toast.

NameTypeDescriptionAvailable in global config?
idstringUnique id to associate with hot-toast. There can't be multiple hot-toasts opened with same id.No
durationnumberDuration in milliseconds after which hot-toast will be auto closed. Can be disabled via autoClose: false
Default: 3000, error = 4000, loading = 30000
Yes
autoClosebooleanAuto close hot-toast after duration
Default: true
Yes
positionToastPositionThe position to place the hot-toast.
Default: top-center
Yes
dismissiblebooleanShow close button in hot-toast
Default: false
Yes
roleToastRoleRole of the live region.
Default: status
Yes
ariaLiveToastAriaLivearia-live value for the live region.
Default: polite
Yes
themeToastThemeVisual appearance of hot-toast
Default: toast
Yes
persist{ToastPersistConfig}Useful when you want to keep a persistance for toast based on ids, across sessions.No
iconContentIcon to show in the hot-toastYes
iconThemeIconThemeUse this to change icon colorYes
classNamestringExtra CSS classes to be added to the hot toast container.Yes
styleanyExtra styles to apply for hot-toastYes
closeStyleanyExtra styles to apply for close buttonYes

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Dharmen Shah

💻 🖋 🎨 📖 💡

Netanel Basal

🐛 💼 🤔 🚧 🧑‍🏫 📆 🔬 👀

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

Icons made by Freepik from www.flaticon.com

Keywords

FAQs

Package last updated on 28 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc