A menu is a dropdown list with a trigger that controls the visibility of the list items. To create an accessible menu, use lightning:buttonMenu. Provide a text label or assistive text, and specify a list of menu items using lightning:menuItem. The dropdown menu items are hidden by default.
This example creates a menu with several items:
<!-- otherprops: set_clipboard --><lightning:buttonMenu iconName="utility:settings"
alternativeText="Settings"
onselect="{! c.handleMenuSelect }">
<lightning:menuItem label="Font" value="font" />
<lightning:menuItem label="Size" value="size"/>
<lightning:menuItem label="Format" value="format" />
</lightning:buttonMenu>
The alternativeText attribute provides a text label that’s hidden from view and available to assistive technology.
lightning:buttonMenu implements the menu blueprint in the Salesforce Lightning Design System and follows its accessibility guidelines.
See Also