Skip to content

pantoken / formats/interactions/src / initRemove

Function: initRemove()

initRemove(target, options?): RemoveHandle

Remove a target after a timeout. Before removal, fires a cancelable, bubbling dismiss event. Preventing that event keeps the target mounted.

The timeout is an explicit millisecond option or the target's computed, unitless --timeout CSS custom property. Missing, non-finite, and non-positive values don't arm a timer. A fade uses the @pantoken/components transition utility's classes (.instui-transition + -fade-*), then waits for transitionend (with a fallback); transition: "none" removes immediately.

Parameters

target

HTMLElement

options?

RemoveOptions = {}

Returns

RemoveHandle