ReadonlyaddedClasses to set on the controlled element after the first usage of add.
Auto clears after adding with the declared duration, in milliseconds. If zero or below, will not be used.
Delay, in milliseconds, after adjusting classes before the content should be cleared.
ReadonlycontainerTarget element that will be used to insert the cloned elements.
ReadonlycontextReadonlyhideClasses to set on the controlled element when clearing content or removed when adding content.
OptionalisInternal tracking of whether a clearing delay is in progress.
ReadonlyshowClasses to set on the controlled element when adding content or removed when clearing content.
Delay, in milliseconds, before adjusting classes on show.
ReadonlytemplateReadonlytemplateStaticblessingsStaticclassesStaticoutletsStatictargetsStaticvaluesStaticshouldAdds a new element to the container based on the type argument provided in the event or action params objects. Optionally clearing the container first with support for added custom text inside the added element.
Optionalevent: CustomEvent<AddOptions> & { params?: AddOptions }If called with an event (or any truthy argument) reset the classes for show/hide so the this method can be used intentionally via actions allowing clearing after animations have run.
Optionalevent: EventIf no type provided, return the first template target, otherwise try to find a matching target, finally fall back on the first template target if nothing is found.
Optionaltype: string | nullStaticafter
Adds the ability for a controlled element to pick an element from a template and then clone that element, adding it to the container. Additionally, it will allow for clearing all previously added elements.
Example: - Using with the w-messages identifier
Example: - Using to show a temporary element with auto-clearing