Newer Version Available
setPanelHeaderIcon() for Lightning Experience
Sets the icon of the current utility’s panel. This icon is displayed in the utility
panel header.
Arguments
| Name | Type | Description |
|---|---|---|
| sldskey | 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. |
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 the SLDS “frozen” icon when the button is pressed.
Component code:
1<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
2 <force:utilityBarAPIAccess aura:id="utilitybar" />
3 <lightning:button label="Set Panel Header Icon" onclick="{! c.setPanelHeaderIcon }"/>
4</aura:component>Controller code:
1({
2 setPanelHeaderIcon : function(component, event, helper) {
3 var utilityAPI = component.find("utilitybar");
4 utilityAPI.setPanelHeaderIcon('frozen');
5 }
6})Response
None.