File

src/modules/toast-notification/services/toast-notification-option.intf.ts

Description

Available options for the toast notifications to be shown via the StarkToastNotificationComponent

Index

Properties

Properties

actionClasses
actionClasses: string[]
Type : string[]

Array containing the CSS classes to be applied to the action button (if the message contains an action to be displayed)

delay
delay: number
Type : number

How many milliseconds the toast will be displayed before automatically closing. If set to 0, the toast will stay open until closed manually

position
position: StarkToastNotificationPosition
Type : StarkToastNotificationPosition

The position where the toast will be shown: any combination of "bottom"/"left"/"center"/"start"/"end" and "top"/"right"

import { InjectionToken } from "@angular/core";

/**
 * Type defining the position of the MatSnackBar on the screen.
 */
export type StarkToastNotificationPosition = "bottom left" | "bottom right" | "top left" | "top right";

/**
 * {@link https://v12.angular.io/api/core/InjectionToken|InjectionToken} used to provide the {@link StarkToastNotificationPosition}
 */
export const STARK_TOAST_NOTIFICATION_OPTIONS: InjectionToken<StarkToastNotificationOptions> =
	new InjectionToken<StarkToastNotificationOptions>("StarkToastNotificationOptions");

/**
 * Available options for the toast notifications to be shown via the {@link StarkToastNotificationComponent}
 */
export interface StarkToastNotificationOptions {
	/**
	 * How many milliseconds the toast will be displayed before automatically closing.
	 * If set to `0`, the toast will stay open until closed manually
	 */
	delay: number;

	/**
	 * The position where the toast will be shown: any combination of `"bottom"/"left"/"center"/"start"/"end"` and `"top"/"right"`
	 */
	position: StarkToastNotificationPosition;

	/**
	 * Array containing the CSS classes to be applied to the action button (if the message contains an action to be displayed)
	 */
	actionClasses: string[];
}

results matching ""

    No results matching ""