Modifiers are functions applied to a DOM node, whose lifecycles are tied to the DOM lifecycle.

References:

Examples

Parameter-less

Set focus on an element when it is inserted:


<input type='text' {{autofocus}} />

Positional parameters only

Image that we want a given component to allow the caller to manually override the background color:

function setBackgroundColor(element, [color]) {
		el.style.backgroundColor = color;
}

Named parameters only