You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@aminekun90/ngx-toast

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aminekun90/ngx-toast

A lightweight, high-performance, and **Zoneless-ready** toast notification library for Angular 20+.

latest
Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
26K
70.13%
Maintainers
1
Weekly downloads
 
Created
Source

ngx-toast 🍞

A lightweight, high-performance, and Zoneless-ready toast notification library for Angular 20+.

Angular Version Maintenance version number Actions Status License node-current Socket Badge NPM

Demo app and usage

View Demo

Key Features

  • Angular 20+ Optimized: Fully supports provideZonelessChangeDetection().
  • 📡 Signal-based: Built with Angular Signals for reactive and efficient state management.
  • 🎨 FontAwesome Integration: Built-in support for professional iconography.
  • 🛠 Customizable: Easy control over duration, progress bars, and screen positions.
  • 📦 Yarn 4 Ready: Developed and optimized using modern Yarn Berry.

Installation

Install the package via Yarn:

yarn add ngx-toast

Peer Dependencies

Since the library uses FontAwesome for its visual components, ensure the following are installed in your project:

yarn add @fortawesome/angular-fontawesome @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons

Configuration

Add the necessary providers to your app.config.ts (or config.ts). It is highly recommended to use provideAnimationsAsync() for smooth transitions.

import { ApplicationConfig } from '@angular/core';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import { FaIconLibrary } from '@fortawesome/angular-fontawesome';
import { fas } from '@fortawesome/free-solid-svg-icons';

export const appConfig: ApplicationConfig = {
  providers: [
    provideAnimationsAsync(),
    {
      provide: 'INITIALIZE_FA',
      useFactory: (library: FaIconLibrary) => library.addIconPacks(fas),
      deps: [FaIconLibrary]
    }
  ]
};

Usage

1. Add the Global Container

Place the ngx-toast-container in your root component (app.ts or app.component.html). This container will handle the stacking and positioning of all active toasts.

import { ToastContainerComponent } from 'ngx-toast';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [ToastContainerComponent],
  template: `
    <router-outlet></router-outlet>
    <ngx-toast></ngx-toast>
  `
})
export class App {}

2. Triggering Notifications


import { Component, inject } from '@angular/core';
import { ToastService } from 'ngx-toast';

@Component({ ... })
export class MyComponent {
  private toastService = inject(ToastService);

  showSuccess() {
    this.toastService.show({
      type: 'success',
      title: 'Success!',
      message: 'The operation was completed successfully.',
      duration: 3000,
      progressBar: true,
      position: 'bottom-right'
    });
  }
}

API Reference

PropertyTypeDefaultDescription
type'success' | 'error' | 'warning' | 'info''info'Defines the visual theme and icon of the toast.
titlestringundefinedOptional bold heading displayed above the message.
messagestring""The primary text content of the notification.
durationnumber5000Time in milliseconds before auto-close (0 for infinite).
progressBarbooleanfalseIf true, displays a visual countdown

Compatibility

ngx-toastAngular VersionNode.js VersionChange Detection
1.0.x^21.2.0^22.x | ^24.xZoneless & Zone.js

This library is built with Angular 21 and above. Node 24.13.0 or higher is required.

Keep this project alive :coffee:

I dedicate time and effort on writing and maintaining this library and if it helped you and saved you time, please consider Donating!

I'm grateful for your support.

Donate via PayPal

PayPal

Licence

MIT License, By Amine Bouzahar.

Keywords

angular

FAQs

Package last updated on 18 Mar 2026

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