Newer Version Available

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

setPanelHeight() for Lightning Experience

Sets the utility panel’s height.

Arguments

Name Type Description
heightPX integer The height of the utility panel in pixels.

Sample Code

This component, when added to a single-column Lightning page used in a utility bar, sets the height of the utility to 500 pixels when the button is pressed.

Component code:

1<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
2    <force:utilityBarAPIAccess aura:id="utilitybar" />
3    <lightning:button label="Set Panel Height" onclick="{! c.openUtility }"/>
4</aura:component>

Controller code:

1({
2    setPanelHeight : function(component, event, helper) {
3        var utilityAPI = component.find("utilitybar"); 
4        utilityAPI.setPanelHeight(500);
5    }
6})

Response

None.