@umbraco-cms/backoffice

    UmbIconRegistry

    • Icon Registry. Provides icons from the icon manifest. Icons are loaded on demand. All icons are prefixed with 'icon-'

    Hierarchy

    • UUIIconRegistry
      • UmbIconRegistry
    Index

    Constructors

    Methods

    • Attach an element to provide this registry. Use detach when disconnected.

      Parameters

      • element: EventTarget

        the element of which to provide this icon-set.

      Returns void

    • Define a icon to be served by this registry.

      Parameters

      • iconName: string

        the name to use for this icon.

      • svgString: string

        the svg source for this icon.

      Returns void

    • Detach an element from providing this registry.

      Parameters

      • element: EventTarget

        the element of which to stop providing this icon-set.

      Returns void

    • Retrieve the SVG source of an icon, Returns ´null´ if the name does not exist.

      Parameters

      • iconName: string

        the name of the icon to retrieve.

      Returns null | Promise<string>

    • Dynamic concept by extending this class: extend getIcon in this way:

      protected acceptIcon(iconName: string): boolean {

      // Check if this is something we want to accept and provide. if(iconName === "myCustomIcon") {

       // Inform that we will be providing this.
       const icon = this.provideIcon(iconName);
      
       // When data is available set it on this icon object, this can be done at any point in time:
       icon.svg = "...";
      
       return true;
      

      }

      return false; }

      Returns string[]

    • Declare that this registry will be providing a icon for this name

      Parameters

      • iconName: string

        the name of the icon to be provided.

      Returns UUIIconHost

    MMNEPVFCICPMFPCPTTAAATR