Newer Version Available

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

setPanelWidth() for Lightning Experience

Sets the utility panel’s width.

Arguments

Name Type Description
widthPX integer The width 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 width of the utility panel to 800 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 Width" onclick="{! c.setPanelWidth }"/>
4</aura:component>

Controller code:

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

Response

None.