Newer Version Available
openUtility() for Lightning Experience
Opens the current utility. If the utility is already open, this method has no effect.
Only one utility can be open at a time. If another utility is already open, it is
minimized.
Arguments
None.
Sample Code
This component, when added to a single-column Lightning page used in a utility bar, opens the 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="Open Utility" onclick="{! c.openUtility }"/>
4</aura:component>Controller code:
1({
2 openUtility : function(component, event, helper) {
3 var utilityAPI = component.find("utilitybar");
4 utilityAPI.openUtility();
5 }
6})Response
None.