NgxToastf
Features
- Toast Component Injection without being passed
ViewContainerRef
- Animations using Angular's
Dependencies
Latest version available for each version of Angular
ngx-toastf | Angular |
---|---|
1.0.0 | 9.x 8.x 7.x |
Install
npm install ngx-toastf --save
@angular/animations
package is a required dependency for the default toast
npm install @angular/animations --save
Setup
step 1: Add NgToastModule to appModule, make sure you have BrowserAnimationsModule as well
;; ;
step 2: Add icons styles to angular.json file in styles array
"styles": ,
Use
;
Options
There are global options.
Global Options
Global options include the following options:
Option | Type | Default | Description |
---|---|---|---|
title | string | null | Title for toast message |
position | object | see below | Toast container position |
duration | number | 3000 | Time to live in milliseconds |
closeButton | boolean | false | Show close button |
tapDismiss | boolean | false | Close on click |
autoClose | boolean | true | Dismiss current toast when max is reached |
position defaults
NgToastPosition ;
Styles
Global Styles
Class | Description |
---|---|
toast-container | Toast container |
toast-container-title | Toast container title, and symbol |
toast-container-body | Toast container for message |
Toast type styles
For customizations styles you can overwrite those classes:
- .toast-container-success
- .toast-container-info
- .toast-container-warning
- .toast-container-error
.toast-container
License
MIT
GitLab @darioegb ·