• Loads a specific SVG file from 'skin/icon' folder. Handles duplicate requests and asynchronous loading. Instead of returning the SVG code, this method provides a live DOM element, which is faster.

    Doesn't need to be called directly as it's automatically used by HTML like

    <div data-icon=’closeTab’></div>
    

    The loaded icon can be further styled by CSS, e.g.

    fill: red;
    

    Parameters

    • iconName: string

      Name of the icon to load, without extension, e.g. 'close'.

    • Optional callback: Callback<SVGElement>

      Function to call, when icon content is loaded.

    Returns SVGElement | undefined

    SVG element.

    Method

    loadIconFast