File

projects/ng-snotify/src/lib/interfaces/snotify-toast-config.interface.ts

Description

Toast configuration object

Index

Properties

Properties

animation
animation: SnotifyAnimate
Type : SnotifyAnimate
Optional

Animation config

backdrop
backdrop: number
Type : number
Optional

Backdrop opacity.

  • Range: 0.0 - 1.0.
  • Disabled: -1
bodyMaxLength
bodyMaxLength: number
Type : number
Optional

Toast body maximum length

buttons
buttons: SnotifyButton[]
Type : SnotifyButton[]
Optional

Buttons config.

closeOnClick
closeOnClick: boolean
Type : boolean
Optional

Should toast close on click?

html
html: string | SafeHtml
Type : string | SafeHtml
Optional

Html string witch overrides toast content

icon
icon: string
Type : string
Optional

Activate custom icon. You should provide full tag, e.g.

```html

  • html
  • <path....../>
  • ```
iconClass
iconClass: string
Type : string
Optional

Custom icon class.

pauseOnHover
pauseOnHover: boolean
Type : boolean
Optional

Should timeout pause on hover?

placeholder
placeholder: string
Type : string
Optional

Placeholder for Prompt toast

position
position: SnotifyPosition
Type : SnotifyPosition
Optional

Toasts position on screen

showProgressBar
showProgressBar: boolean
Type : boolean
Optional

Enable/Disable progress bar. Disabled if timeout is 0.

timeout
timeout: number
Type : number
Optional

Toast timeout in milliseconds. Disable timeout = 0

titleMaxLength
titleMaxLength: number
Type : number
Optional

Toast title maximum length

type
type: SnotifyType
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;
}

result-matching ""

    No results matching ""