Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

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.