Newer Version Available
setPanelHeaderLabel() for Lightning Experience
Sets the label of a utility’s panel. This label 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 label on. Optional when called within a utility. |
| label | string | The label of the utility displayed in the panel header. |
Aura Components Sample Code
This component, when added to a single-column Lightning page used in a utility bar, sets the label of the utility panel to “My Utility” when the button is pressed.
Component code:
1<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
2 <lightning:utilityBarAPI aura:id="utilitybar" />
3 <lightning:button label="Set Panel Header Label" onclick="{! c.handleSetPanelHeaderLabel }" />
4</aura:component>Controller code:
1({
2 handleSetPanelHeaderLabel : function(component, event, helper) {
3 var utilityAPI = component.find("utilitybar");
4 utilityAPI.setPanelHeaderLabel({
5 label: "My Utility"
6 });
7 }
8})Response
This method returns a promise that, upon success, resolves to true.