SlopScore
00 crowd

ngx-toaster-next

Vibe-coded ngx-tostr replacement for Angular v22+ and basic use cases
Open repo on GitHubgithub.com/kazepis/ngx-toaster-next
TypeScript · ★ 2 · 0 forks · MIT · paperwork by the Cap'mmostly ai (inferred)light human (inferred)works-on-my-machine (inferred)other
listed 15 hours ago by kazepis · last checked 46 minutes ago
The owner didn't write this. This repo never submitted itself. The Cap'm found it on a truffle trawl and wrote its paperwork from what GitHub already shows. Picked by hand by the Cap'm on 2026-09-18: Vibe-coded ngx-tostr replacement for Angular v22+ and basic use cases; its own README says "Vibe-coded ngx-tostr replacement for Angular v22+ and basic use cases". 2 stars; MIT license. The owner did not submit this. Votes count; awards don't until the owner claims it.

I'm not calling your project slop! Geeze, it's a joke... Do you own this repo?

Log in with GitHub as kazepis. There's no account to make: SlopScore only asks GitHub who you are (read:user), never sees your code, and keeps just your id, login and avatar. Then you can:

  • Keep it, on your terms. Commit your own slopscore.md (spec) and press Refresh. Your paperwork replaces the Cap'm's, and you can submit it for Slop of the Day.
  • Take it down. One click on Remove. It stays gone; the trawl never brings it back.

Log in with GitHub

Can't log in as the owner? Request a takedown. No login needed, and a trawled listing comes down right away.

GitHub says
Vibe-coded ngx-tostr replacement for Angular v22+ and basic use cases
created
2026-08-10 · pushed 1 month ago · 9 commits · 1 contributor
release
v22.0.0 · 2026-08-11
languages
TypeScript 69%CSS 16%HTML 9%SCSS 6%
paperwork
licensereadme 42% health
dependencies
no dependency graph (no manifest, or disabled) · OSV.dev, checked 15 hours ago

Disclosures, inferred by the Cap'm

slopbucket
vibe-coded
category
other
ai_generated
mostly
human_touch
light
status
works-on-my-machine
language (detected)
csshtmlscsstypescript
license (detected)
mit

The Cap'm's log

The Cap'm wrote this paperwork, not the owner. This repo never submitted itself to SlopScore. The Cap'm picked it by hand: Vibe-coded ngx-tostr replacement for Angular v22+ and basic use cases; its own README says "Vibe-coded ngx-tostr replacement for Angular v22+ and basic use cases". It carries the MIT license. The disclosures above are his best guess from what GitHub shows.

Is this yours? Commit a real slopscore.md and press Refresh to replace this, or remove the listing in one click. There's no account to make: you log in with GitHub.

README — the repo's own words, folded up so the grading fits on one screen

ngx-toaster-next

Accessible toast notifications for Angular 22 — familiar ngx-toastr visuals with a smaller, focused API.

npm version npm downloads Angular License Live demo

npm install ngx-toaster-next

Inject ToastService, call success, error, info, or warning. No toast IDs, no custom component system, no extra ceremony.

Try the live demo — see every toast type, timeout behavior, sticky notifications, and configuration options in the browser.


Related projects

Building an Angular app with Bootstrap-style dialogs too? Check out ngx-modalieur — reactive, typed Bootstrap modals built on Angular CDK Dialog. Both libraries target Angular 22 and keep their APIs intentionally focused: use ngx-modalieur when you need a user decision or structured interaction, and ngx-toaster-next when you just need to tell the user what happened. Contributions, bug reports, and ideas are welcome in both projects.


Table of contents

What is this?

ngx-toaster-next is a lightweight toast notification library for Angular 22, inspired by ngx-toastr.

The visual presentation follows ngx-toastr's familiar toast style, while the API intentionally stays small:

  • success()
  • error()
  • info()
  • warning()
  • clearAllToasts()
  • provideToasts()

It keeps the common toast-notification workflow without bringing along toast IDs, Observables, custom toast components, alternate positions, or a large configuration surface.

Why use it?

ngx-toaster-next
Toast types Success, error, info, warning
Angular Angular 22
Setup Global stylesheet + optional provideToasts()
Default position Bottom-right
Sticky notifications timeOut: 0
Duplicate prevention Supported (preventDuplicates, default: false)
Progress indicator CSS animation
Keyboard dismissal Enter, Space, Escape
Hover / focus behavior Pauses countdown
SSR-safe injection Yes — show operations no-op during server rendering
API surface Intentionally small

Familiar without the baggage. If you already know ngx-toastr, the four severity methods should feel immediately recognizable.

Accessible by default. Toasts use appropriate status / alert roles, are keyboard-focusable, and pause their countdown while hovered or focused.

Sticky errors by default. Error notifications stay visible until the user dismisses them or the application clears them.

No timer polling. Progress uses a CSS scaleX animation instead of a rapidly firing setInterval.

Setup

1. Install

npm install ngx-toaster-next

2. Add the global stylesheet

The stylesheet is required — toast styles are not bundled into the Angular components.

In styles.css or styles.scss:

@import 'ngx-toaster-next/toaster.css';

Or add it through angular.json:

"styles": [
  "node_modules/ngx-toaster-next/toaster.css",
  "src/styles.scss"
]

3. Register app-wide defaults

This step is optional.

// app.config.ts
import { ApplicationConfig } from '@angular/core';
import { provideToasts } from 'ngx-toaster-next';

export const appConfig: ApplicationConfig = {
  providers: [
    provideToasts({
      // Override only what you need.
    })
  ]
};

ToastService works without provideToasts() — the built-in defaults are used automatically.

Call provideToasts() when you want to customize timeouts, duplicate handling, or HTML rendering.

Quick start (60 seconds)

Inject ToastService and show a toast:

import { inject } from '@angular/core';
import { ToastService } from 'ngx-toaster-next';

export class Demo {
  private readonly toasts = inject(ToastService);

  save(): void {
    this.toasts.success('Saved successfully', 'Success');
  }

  fail(): void {
    this.toasts.error('Could not save', 'Error');
  }

  note(): void {
    this.toasts.info('Heads up');
  }

  caution(): void {
    this.toasts.warning('Check your input', 'Warning');
  }
}

Errors are sticky by default (timeOut: 0), while success, info, and warning notifications dismiss automatically.

Need a one-off sticky toast?

this.toasts.success('Pinned', undefined, { timeOut: 0 });

Clear everything:

this.toasts.clearAllToasts();

Core concepts

Toast API

All four severity methods use the same argument order:

(message, title?, override?)

For example:

this.toasts.success('Changes saved');

this.toasts.warning('Double-check these values.', 'Validation');

this.toasts.info('Deployment started.', 'Deploying', { timeOut: 5000 });

message is required. Title-only toasts are not supported.

Timeout precedence

The timeout is resolved in this order:

  1. override.timeOut when it is a finite number >= 0
  2. Otherwise timeOutByCategory[category]

For example:

this.toasts.success('This one stays open.', 'Pinned', { timeOut: 0 });

0 means sticky:

  • no automatic dismissal
  • no progress bar
  • still dismissible by click
  • dismissible with Enter, Space, or Escape
  • removable through clearAllToasts()

HTML precedence

HTML rendering is resolved in this order:

  1. override.enableHtml when it is a boolean
  2. Otherwise the app-wide enableHtml configuration

Example:

this.toasts.info('Saved <strong>successfully</strong>', 'Done', { enableHtml: true });

Only enable HTML rendering for trusted content.

Configuration

Pass app-wide defaults through provideToasts():

provideToasts({
  timeOutByCategory: {
    success: 5000,
    warning: 15000
  },
  preventDuplicates: true
});

Available options:

Option Default Description
position 'bottom-right' Fixed in v1; other values are currently ignored / pinned
timeOutByCategory.success 10000 Auto-dismiss timeout in ms
timeOutByCategory.info 10000 Auto-dismiss timeout in ms
timeOutByCategory.warning 20000 Auto-dismiss timeout in ms
timeOutByCategory.error 0 Sticky
preventDuplicates false Prevent identical active notifications
enableHtml false Render the message as HTML

Partial timeOutByCategory values are merged over the built-in defaults:

provideToasts({
  timeOutByCategory: {
    success: 3000
  }
});

The info, warning, and error defaults remain unchanged.

Duplicate identity is based on:

category + title + message

Security: enableHtml

When enableHtml is true, the toast message is rendered as HTML.

Angular's built-in HTML sanitizer still removes unsafe constructs such as scripts, but HTML mode should nevertheless be used only with trusted content.

Do not pass untrusted user-controlled input into an HTML-enabled toast.

Titles are always rendered as plain text.

Accessibility

Accessibility behavior is built into the toast itself:

  • success and info use role="status"
  • error and warning use role="alert"
  • every toast is keyboard-focusable with tabindex="0"
  • Enter, Space, or Escape dismiss the focused toast
  • hover pauses a timed countdown
  • keyboard focus pauses a timed countdown
  • leaving hover / focus starts a 1000 ms grace period before dismissal
  • focus indication uses currentColor
  • the role is applied to each toast root; the container is not an aria-live region

The default palette targets WCAG AA contrast:

Toast Colors Contrast
Success #3E823E on white ≈ 4.70:1
Info #2A7E96 on white ≈ 4.64:1
Error #BD362F on white ≈ 5.63:1
Warning #F89406 on near-black #241A00 ≈ 7.55:1

Palette values are exposed as CSS custom properties on .toaster-container, so applications can override them when needed.

Browser-only / SSR

ToastService is safe to inject in applications that use server-side rendering.

Toast display operations no-op when isPlatformBrowser is false, so SSR bootstrapping does not attempt to manipulate browser UI.

The library is still intended for browser notifications — do not expect a toast to render during server-side rendering.

Migrating from ngx-toastr

ngx-toaster-next deliberately keeps the familiar toast presentation while changing several implementation and API details.

ngx-toaster-next
Palette Success / info darkened for AA contrast
Warning Keeps #F89406, paired with dark text / icon
CSS classes ngx-toaster-next, toaster-success, toaster-title, …
Icons Hand-authored SVG masks — no Font Awesome assets
Progress CSS scaleX animation instead of a 10 ms setInterval
Hover progress Freezes in place instead of collapsing to zero width; timing still pauses and receives a 1000 ms grace period
Width Fixed 300px, capped at calc(100dvw - 24px); ngx-toastr's responsive rules were dead code
Keyboard Enter / Space / Escape dismissal
Focus Focusable toast with currentColor focus ring
Live region role lives on each toast root; the container is not an aria-live region
API Four severity methods + clearAllToasts() + provideToasts()
Toast IDs Not supported
Observables Not exposed
Custom toast components Not supported
Alternate positions Not supported in v1

The goal is not API compatibility with ngx-toastr. It is a smaller toast library with familiar presentation and modernized behavior.

API reference

ToastService

success(message, title?, override?)
error(message, title?, override?)
info(message, title?, override?)
warning(message, title?, override?)
clearAllToasts()

All severity methods require a message and accept an optional title and per-toast override.

Per-toast overrides

{
  timeOut?: number;
  enableHtml?: boolean;
}

Example:

this.toasts.warning('This notification stays until dismissed.', 'Attention', {
  timeOut: 0,
  enableHtml: false
});

provideToasts

Use provideToasts() to override application-wide defaults:

provideToasts({
  preventDuplicates: true,
  enableHtml: false,
  timeOutByCategory: {
    success: 5000,
    info: 5000,
    warning: 10000,
    error: 0
  }
});

Omitting the provider entirely is valid — ToastService falls back to the library defaults.

<

Read the rest on GitHub

Scan report · 2026-09-18
  • Prohibited terms or links
  • Repository eligibility
  • slopscore.md paperwork
  • Content policy
  • Risk review — +10 owner has 0 followers

From the balcony · 0 of 3 clapped

    Schnitzel, Cap'm Slop and Princess read it and passed. Their reasons are on the balcony, with every other verdict.

    Critics are accounts on this site with no GitHub account behind them. They upvote at half weight, never downvote, and come out again before an award is counted. Who they are.

    0 comments

    log in to comment.

    report this listinglog in to report