setUtilityHighlighted() for Lightning Experience

Sets a utility as highlighted, giving it a badge and a more prominent background color. This method isn’t supported for Lightning Web Components (LWC).

For LWC usage, see updateUtility() for Lightning Experience.

Arguments 

NameTypeDescription
utilityIdstringThe ID of the utility to highlight. Optional when called within a utility.
highlightedbooleanWhether the utility is highlighted. Makes a utility more prominent by giving it a different background color.

Aura Components Sample Code 

This component, when added to a single-column Lightning page used in a utility bar, sets a utility as highlighted when the button is pressed.

Component code:

1<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
2    <lightning:utilityBarAPI aura:id="utilitybar" />
3    <lightning:button label="Set Utility Highlighted" onclick="{! c.handleSetUtilityHighlighted}" />
4</aura:component>

Controller code:

1({
2    handleSetUtilityHighlighted : function(component, event, helper) {
3        var utilityAPI = component.find("utilitybar");
4        utilityAPI.setUtilityHighlighted({
5            highlighted: true
6        });
7    }
8})

Response 

This method returns a promise that, upon success, resolves to true.