Set Console App’ Tab Icon size

I have a Console app with a custom Lightning page where I have set the tab icon and name using:

 workspaceAPI.setTabLabel({
                tabId: focusedTabId,
                label: a
            });
             workspaceAPI.setTabIcon({
                tabId: focusedTabId,
                 icon: "utility:description",
                 iconAlt: "Description",
             });

I am having trouble setting the size of the tab icon to small.

enter image description here

Answer

tl;dr – use “standard” icons

In case it is helpful for future readers, I was able to find a solution to this.

I was just building out an aura tab and encountered this same issue. While most icons appeared too large for the tab, I found that any icons selected from the “standard” category rendered correctly (in both size and color). The list of “standard” icons can be found here.

Code Example with Images

For example, in the setTabIcon method:

 workspaceAPI.setTabIcon({
    tabId: focusedTabId,
     icon: "utility:custom_apps",
     iconAlt: "Description",
 });

using an icon selection like this will render the icon incorrectly:

icon: "utility:custom_apps",

enter image description here

But using a standard icon will render the size and color appropriate for lightning tabs

icon: "standard:custom"

enter image description here

Attribution
Source : Link , Question Author : Akash , Answer Author : Jwok

Leave a Comment