Skip to main content

IconElement

Provides a base class you can use to create a web component that can render an icon anywhere in your markup. An example of this is in our BPMN starter application, where we extend this component to create a component that can render BPMN icons in the object inspector.

This class expects an icon-id attribute, which identifies the icon you wish to render. By default this class will look for the icon in the defaultIcons map. Subclasses can override the findIcon method to implement custom behaviour. When a subclass returns null, the defaultIcons are tested.

Extends

  • HTMLElement

Methods

findIcon()

findIcon(id): IconDefinition

Finds an icon by ID. Subclasses will want to extend this. If a subclass returns null, the defaultIcons map is tested for the icon.

Parameters

id

string

Returns

IconDefinition