Newer Version Available
setPanelHeaderLabel() for Lightning Experience
Sets the label of the current utility’s panel. This label is displayed in the utility
panel header.
Arguments
| Name | Type | Description |
|---|---|---|
| label | string | The label of the utility displayed in the panel header. |
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 <force:utilityBarAPIAccess aura:id="utilitybar" />
3 <lightning:button label="Set Panel Header Label" onclick="{! c.setPanelHeaderLabel }"/>
4</aura:component>Controller code:
1({
2 setPanelHeaderLabel : function(component, event, helper) {
3 var utilityAPI = component.find("utilitybar");
4 utilityAPI.setPanelHeaderLabel('My Utility');
5 }
6})Response
None.