Newer Version Available
EnclosingUtilityId Context Wire Adapter for Lightning Experience
Determines if the component is within a utility. This wire adapter is available for
Lightning Web Components (LWC) only.
To obtain the ID of the enclosing utility, use this context wire adapter. If a caller component isn’t using the wire adapter inside a panel, the enclosing utility ID is null.
LWC Sample Code
Before you can use the LWC utility bar API, Lightning Web Security must be enabled.
This component minimizes a utility bar panel using the enclosing utility ID and the minimize() method.
To make your component available for use in a utility bar, specify the lightning__UtilityBar target in the component’s configuration file.
Response
Returns the enclosing utility ID if the caller component is within a utility, or null otherwise.