Components Toast

Toast

Overview API Examples Style Tokens

LmnToastComponent

import {LmnToastComponent} from "@elemental/ui";
Decorators:@Component
Selectors:lmn-toast
Implements:OnDestroyAfterViewInit

Properties

NameTypeDescription
activateAction
r
OutputEmitterRef<void>

Emits when the toast's action is activated

close
() => Promise<void>

Closes the toast element by playing the animation and emitting the closeToast event.

closeTimeout
r
InputSignal<number>

Timeout for the toast to close. In seconds

closeToast
r
OutputEmitterRef<void>

Emits when the toast is closed.

content
r
InputSignal<string | TemplateRef<unknown>>

Content of the toast.

nativeElement
r
HTMLElement
negative
r
InputSignalWithTransform<boolean, unknown>

Whether the toast is negative.

persistency
r
InputSignal<LmnToastPersistency>

Whether the toast should be persistent or timed.

position
r
InputSignal<LmnToastPosition>

Position of the toast.

type
r
InputSignal<LmnToastType>

Type of the toast.

Accessors

get id

The unique identifier of the toast.

Presentation
get id(): string;
Type

string

Methods

addTranslationAnimationFromOutside()

Adds a translation animation to the native element.

Presentation
addTranslationAnimationFromOutside(isUpward: boolean, height: string): void;
Parameters
NameTypeDescription
isUpward
boolean

@param {boolean} isUpward - Indicates whether the translation is from above (true) or below (false).

height
string

@param {string} height - The height value to translate by, e.g., '100px'.The translation length consists of the value + #marginbetween.

Returns
void

LmnToastService

import {LmnToastService} from "@elemental/ui";
Decorators:@Injectable
Implements:OnDestroy

Accessors

set defaultConfiguration

Setter method for the default configuration of the toast.

Presentation
set defaultConfiguration(defaultConfiguration: LmnToastDefaultConfiguration);
Type

LmnToastDefaultConfiguration

set maxNumberOfToasts

Setter method for the max number of toast.

Presentation
set maxNumberOfToasts(numberOfToast: number);
Type

number

set parent

Setter method for the parent element of the toast containers.

Presentation
set parent(parent: HTMLElement);
Type

HTMLElement

Methods

showToast()

Show the toast notification.

Presentation
showToast(configuration: LmnToastConfiguration): void;
Parameters
NameTypeDescription
configuration
LmnToastConfiguration

@param configuration

Returns
void