setPanelHeaderIcon() for Lightning Experience
Sets the icon of a utility’s panel. This icon is displayed in the utility panel header.
This method isn’t supported for Lightning Web Components (LWC).
For LWC usage, see updatePanel().
Arguments
Name | Type | Description |
---|---|---|
utilityId | string | The ID of the utility to set the panel header icon on. Optional when called within a utility. |
icon | string | An SLDS utility icon key. This is displayed in the utility bar. See a full list of utility icon keys on the SLDS reference site. |
options | object | Optional. Additional options that modify the appearance of the utility panel icon. |
Aura Components Sample Code
This component, when added to a single-column Lightning page used in a utility bar, sets the icon of the utility panel to a yellow SLDS “frozen” icon when the button is pressed.
Component code:
<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
<lightning:utilityBarAPI aura:id="utilitybar" />
<lightning:button label="Set Panel Header Icon" onclick="{! c.handleSetPanelHeaderIcon }" />
</aura:component>
Controller code:
({
handleSetPanelHeaderIcon : function(component, event, helper) {
var utilityAPI = component.find("utilitybar");
utilityAPI.setPanelHeaderIcon({
icon: “frozen”
options:{
iconVariant:"warning"
}
});
}
})
Response
This method returns a promise that, upon success, resolves to true.