Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Menus
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:
1<lightning:buttonMenu iconName="utility:settings"
2 alternativeText="Settings"
3 onselect="{! c.handleMenuSelect }">
4 <lightning:menuItem label="Font" value="font" />
5 <lightning:menuItem label="Size" value="size"/>
6 <lightning:menuItem label="Format" value="format" />
7</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.