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.

enablePopout() for Lightning Experience

Toggles pop-out mode on a utility. Enabling pop-out mode on a utility displays the utility in a separate child window. This method is available for Lightning Web Components (LWC) only.

Arguments

Optional parameters are passed into an object as the last argument of the method.

Name Type Description
utilityId string The ID of the utility for which to toggle pop-out mode.
enabled boolean Specifies whether to enable the utility's modal mode.
disabledText string Optional. Hover text for pop-out button when the utility is not enabled for pop-out mode.

LWC Sample Code

This component toggles modal mode in a utility bar.

1import { LightningElement, wire } from 'lwc';
2import { enablePopout, EnclosingUtilityId } from 'lightning/platformUtilityBarApi';
3
4export default class EnablePopoutExample extends LightningElement {
5    @wire(EnclosingUtilityId) utilityId;
6    enable = true;
7    
8    async handleToggle() {
9        const enable = !this.isPopoutEnabled;
10        await enablePopout(this.utilityId, enable, { disabledText: 'disabled' });
11        this.isPopoutEnabled = enable;
12    }
13}

To make your component available for use in a utility bar, specify the lightning__UtilityBar target in the component’s configuration file.

Response

Returns a promise that resolves to true if successful. The promise is rejected on error.