ng-toast-notify
v1.1.2
Published
Lightweight and flexible toast notifications for Angular
Maintainers
Readme
NgToastNotify
Lightweight and flexible toast notifications for Angular simply and effective, perfect to notify the user with short customized messages
This library was generated with Angular CLI version 17.3.0.
Installation
Install via npm
npm install ng-toast-notifyAdd component
Add the placeholder component in your HTML and ensure you have the required imports in your component.ts.
component.html
<toasty></toasty>component.ts
import { ToastType, ToastyComponent, ToastyPromise, ToastyService } from 'ng-toast-notify';
@Component({
selector: 'app-root',
standalone: true,
imports: [ToastyComponent],
templateUrl: './app.component.html',
styleUrl: './app.component.css'
})
export class AppComponent {}Service
Add the ToastyService to your component and use it to display toasts.
Inject the service in your component:
constructor(private _toastyService: ToastyService) { }Display a basic toast!
Use the service to display toasts:
this._toastyService.showToast('Title', 'Message body');Toast types
- Simple toast, title and message
- Info toast
- Success toast
- Warning toast
- Error toast
- None toast
- Html message toast
- Custom css toast
- Long message
- Loading icon
- Promise toast
- Emoji
- Component toast
Toast features
- Close on swipe
- Notify sound (beep)
- Progress bar
- Sticky toast (have to be closed manually)
- Group duplicate toasts
- Schedule toasts
