setIcon

setIcon() function

Insert an SVG into the element from an iconId. Does nothing if no icon associated with the iconId.

Signature:

export function setIcon(parent: HTMLElement, iconId: IconName): void;

Parameters

ParameterTypeDescription
parentHTMLElementthe HTML element to insert the icon
iconIdIconNamethe icon ID

Returns:

void