Newer Version Available

This content describes an older version of this product. View Latest

isUtilityPoppedOut() for Lightning Experience

Determines whether the utility is in a popped-out state. This method isn’t supported for Lightning Web Components (LWC).

To check if a utility is in a popped-out state with LWC, use getInfo() for Lightning Experience.

Arguments

None

Sample Code

This component has a button that, when pressed, states whether the current utility is popped out or not.

Component code:

1<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
2    <lightning:utilityBarAPI aura:id="utilitybar" />
3    <lightning:button label="Is Utility popped out?" onclick="{! c.handleIsUtilityPoppedOut }" />
4    <lightning:textarea label="Popped out?" aura:id="textarea" />
5</aura:component>

Controller code:

1({
2    handleIsUtilityPoppedOut : function(component, event, helper) {
3        var utilityBarAPI = component.find("utilitybar");
4        utilityBarAPI.isUtilityPoppedOut().then(function(response) {
5            component.find('textarea').set('v.value', response);
6        })
7        .catch(function(error) {
8            console.log(error);
9        });
10    }
11})

Response

This method returns a promise that, upon success, resolves to true if the utility is popped out, and false otherwise.