Button Menu
Represents a dropdown menu with a list of actions or functions.
Descriptor
lightning:buttonMenuTargets
Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out / Visualforce, Standalone Lightning App
Example Options
Simple Button MenusButton menus can have disabled menu items. Button Menus Using Icons and Menu AlignmentButton menus can display a utility icon next to the dropdown and change the menu alignment. Button Menu VariantsButton menu variants change the border style and size, or display with a dark background. Checked Menu Items (All Menu Items Can Be Checked)Button menu with checked and unchecked menu items. Checked Menu Items with Icons (One Menu Item Checked at a Time)Button menu with checked and unchecked menu items and optional utility icons.
Simple Button Menus
Button menu with lightning:menuItem
components.
Button menu with some disabled lightning:menuItem
components.
Code
<aura:component> <div class="slds-m-top_medium slds-m-bottom_large"> <h2 class="slds-text-heading_small slds-m-bottom_medium"> Button menu with <code>lightning:menuItem</code> components. </h2> <div class="slds-p-around_medium container lgc-bg"> <lightning:buttonMenu alternativeText="Show menu"> <lightning:menuItem value="MenuItemOne" label="Menu Item One" /> <lightning:menuItem value="MenuItemTwo" label="Menu Item Two" /> <lightning:menuItem value="MenuItemThree" label="Menu Item Three" /> <lightning:menuItem value="MenuItemFour" label="Menu Item Four" /> </lightning:buttonMenu> </div> </div> <div class="slds-m-top_medium slds-m-bottom_large"> <h2 class="slds-text-heading_small slds-m-bottom_medium"> Button menu with some disabled <code>lightning:menuItem</code> components. </h2> <div class="slds-p-around_medium container lgc-bg"> <lightning:buttonMenu alternativeText="Show menu"> <lightning:menuItem value="MenuItemOne" label="Menu Item One" /> <lightning:menuItem value="MenuItemTwo" label="Menu Item Two" disabled="true"/> <lightning:menuItem value="MenuItemThree" label="Menu Item Three" /> <lightning:menuItem value="MenuItemFour" label="Menu Item Four" disabled="true"/> </lightning:buttonMenu> </div> </div> </aura:component>