npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@slck/ngx-notify

v0.1.1

Published

Angular 21 notification library — toast notifications & API tray, signal-based, zero NgRx dependency

Downloads

228

Readme

@slck/ngx-notify

Angular 21+ notification library — signal-based toast notifications & API response tray. Zero NgRx dependency.

Features

  • Toast notifications — success, error, warning, info with auto-dismiss
  • API notification tray — captures HTTP responses via an interceptor, groups & deduplicates messages
  • Signal-based — fully reactive with Angular signals
  • Dark/light mode — respects prefers-color-scheme automatically
  • Zero dependencies beyond @angular/cdk (overlay)

Installation

npm install @slck/ngx-notify

Peer dependencies

"@angular/cdk": ">=21.0.0",
"@angular/common": ">=21.0.0",
"@angular/core": ">=21.0.0",
"rxjs": ">=7.0.0"

Setup

1. Register the provider

// app.config.ts
import { provideNgxNotify } from '@slck/ngx-notify';

export const appConfig: ApplicationConfig = {
  providers: [
    provideNgxNotify({
      toastDefaultDuration: 4000,   // ms, default 5000
      toastMaxCount: 3,             // max simultaneous toasts, default 3
      toastTopOffset: 16,           // px from top, default 16
      tray: {
        maxMessages: 15,            // default 10
        groupSimilarMessages: true, // deduplicate within 5s, default true
        autoCloseDuration: 0,       // ms, 0 = manual close (default)
      },
    }),
  ],
};

2. Add the tray component to your shell (optional — only if using the API tray)

<!-- app.component.html -->
<slck-api-notification-tray />
// app.component.ts
import { ApiNotificationTrayComponent } from '@slck/ngx-notify';

@Component({
  imports: [ApiNotificationTrayComponent],
  ...
})
export class AppComponent {}

Toast Notifications

Inject NotificationService anywhere and call one of the helper methods:

import { NotificationService } from '@slck/ngx-notify';

@Component({ ... })
export class MyComponent {
  private notify = inject(NotificationService);

  save() {
    this.notify.showSuccess('Saved successfully');
    this.notify.showError('Something went wrong', 'Retry', 8000);
    this.notify.showWarning('Low disk space');
    this.notify.showInfo('Sync in progress');
  }
}

Full options via show()

this.notify.show({
  message: 'Upload complete',
  type: 'success',       // 'success' | 'error' | 'warning' | 'info'
  duration: 6000,        // ms — 0 for persistent
  action: 'View',        // optional action label
});

Dismiss all

this.notify.dismissAll();

API Notification Tray

Register the interceptor

// app.config.ts
import { provideHttpClient, withInterceptors } from '@angular/common/http';
import { apiNotificationInterceptor } from '@slck/ngx-notify';

export const appConfig: ApplicationConfig = {
  providers: [
    provideHttpClient(withInterceptors([apiNotificationInterceptor])),
    provideNgxNotify(),
  ],
};

The interceptor automatically captures HTTP responses and errors and routes them to the tray.

Skip a specific request

Add the X-Skip-Notification header — it is stripped before the request is sent:

this.http.get('/api/health', {
  headers: { 'X-Skip-Notification': 'true' }
});

Interact with the tray programmatically

import { ApiNotificationService } from '@slck/ngx-notify';

@Component({ ... })
export class MyComponent {
  private tray = inject(ApiNotificationService);

  // Signals (read-only)
  unreadCount = this.tray.unreadCount;   // Signal<number>
  isVisible   = this.tray.isVisible;     // Signal<boolean>
  messages    = this.tray.messages;      // Signal<ApiNotificationMessage[]>
  primaryType = this.tray.primaryType;   // Signal<NotificationType>

  open()      { this.tray.show(); }
  close()     { this.tray.hide(); }
  clearAll()  { this.tray.clear(); }
  markRead()  { this.tray.markAllRead(); }
}

Configuration Reference

| Option | Type | Default | Description | |---|---|---|---| | toastDefaultDuration | number | 5000 | Auto-dismiss time in ms. 0 = persistent | | toastMaxCount | number | 3 | Max simultaneous toasts | | toastTopOffset | number | 16 | Top offset in px for toast container | | tray.maxMessages | number | 10 | Max messages stored in the tray | | tray.groupSimilarMessages | boolean | true | Deduplicate identical messages within 5s | | tray.autoCloseDuration | number | 0 | Auto-close tray after ms (0 = manual) |


Notification Types

| Type | Usage | |---|---| | 'success' | Successful operations | | 'error' | Failures, HTTP 4xx/5xx | | 'warning' | Non-critical alerts | | 'info' | Neutral information |


License

MIT