projects/ng-snotify/src/lib/interfaces/snotify-toast-config.interface.ts
Toast configuration object
Properties |
|
animation |
animation:
|
Type : SnotifyAnimate
|
Optional |
Animation config |
backdrop |
backdrop:
|
Type : number
|
Optional |
Backdrop opacity.
|
bodyMaxLength |
bodyMaxLength:
|
Type : number
|
Optional |
Toast body maximum length |
buttons |
buttons:
|
Type : SnotifyButton[]
|
Optional |
Buttons config. |
closeOnClick |
closeOnClick:
|
Type : boolean
|
Optional |
Should toast close on click? |
html |
html:
|
Type : string | SafeHtml
|
Optional |
Html string witch overrides toast content |
icon |
icon:
|
Type : string
|
Optional |
Activate custom icon. You should provide full tag, e.g. ```html
|
iconClass |
iconClass:
|
Type : string
|
Optional |
Custom icon class. |
pauseOnHover |
pauseOnHover:
|
Type : boolean
|
Optional |
Should timeout pause on hover? |
placeholder |
placeholder:
|
Type : string
|
Optional |
Placeholder for Prompt toast |
position |
position:
|
Type : SnotifyPosition
|
Optional |
Toasts position on screen |
showProgressBar |
showProgressBar:
|
Type : boolean
|
Optional |
Enable/Disable progress bar. Disabled if timeout is 0. |
timeout |
timeout:
|
Type : number
|
Optional |
Toast timeout in milliseconds. Disable timeout = 0 |
titleMaxLength |
titleMaxLength:
|
Type : number
|
Optional |
Toast title maximum length |
type |
type:
|
Type : SnotifyType
|
Optional |
Type of toast, affects toast style. It's not recommended to change it. Depends on toast type. |
import { SnotifyButton } from './snotify-button.interface';
import { SnotifyAnimate } from './snotify-animate.interface';
import { SnotifyType } from '../types/snotify.type';
import { SafeHtml } from '@angular/platform-browser';
import { SnotifyPosition } from '../enums/snotify-position.enum';
/**
* Toast configuration object
*/
export interface SnotifyToastConfig {
/**
* Toast timeout in milliseconds.
* Disable timeout = 0
*/
timeout?: number;
/**
* Enable/Disable progress bar.
* Disabled if timeout is 0.
*/
showProgressBar?: boolean;
/**
* Type of toast, affects toast style.
* It's not recommended to change it.
* Depends on toast type.
*/
type?: SnotifyType;
/**
* Should toast close on click?
*/
closeOnClick?: boolean;
/**
* Should timeout pause on hover?
*/
pauseOnHover?: boolean;
/**
* Buttons config.
*/
buttons?: SnotifyButton[];
/**
* Placeholder for Prompt toast
*/
placeholder?: string;
/**
* Toast title maximum length
*/
titleMaxLength?: number;
/**
* Toast body maximum length
*/
bodyMaxLength?: number;
/**
* Activate custom icon.
* You should provide full tag, e.g.
* ```html
* <img src="assets/custom-icon.png"/>
* ```
* ```html
* <svg x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 48 48;" xml:space="preserve" width="48px" height="48px">
* <g><path....../></g>
* </svg>
* ```
*/
icon?: string;
/**
* Custom icon class.
*/
iconClass?: string;
/**
* Backdrop opacity.
* * **Range:** `0.0 - 1.0`.
* * **Disabled:** `-1`
*/
backdrop?: number;
/**
* Animation config
*/
animation?: SnotifyAnimate;
/**
* Html string witch overrides toast content
*/
html?: string | SafeHtml;
/**
* Toasts position on screen
*/
position?: SnotifyPosition;
}