• Overview
@angular/aria/menu

Menu

directive

A list of menu items.

API

    
      class Menu<V> {}
    
    

element

HTMLElement

A reference to the menu element.

textDirection

any

A signal wrapper for directionality.

id

any

The unique ID of the menu.

wrap

any

Whether the menu should wrap its items.

typeaheadDelay

any

The delay in seconds before the typeahead buffer is cleared.

parent

any

A reference to the parent menu item or menu trigger.

items

() => any

The menu items as a writable signal.

TODO(wagnermaciel): This would normally be a computed, but using a computed causes a bug where sometimes the items array is empty. The bug can be reproduced by switching this to use a computed and then quickly opening and closing menus in the dev app.

isVisible

any

Whether the menu is visible.

onSubmit

any

A callback function triggered when a menu item is selected.

close

void

Closes the menu.

@paramopts{ refocus?: boolean | undefined; } | undefined
@returnsvoid

closeAll

void

Closes all parent menus.

@paramopts{ refocus?: boolean | undefined; } | undefined
@returnsvoid

Description

A list of menu items.

A menu is used to offer a list of menu item choices to users. Menus can be nested within other menus to create sub-menus.

<button ngMenuTrigger menu="menu">Options</button><div ngMenu #menu="ngMenu">  <div ngMenuItem>Star</div>  <div ngMenuItem>Edit</div>  <div ngMenuItem>Delete</div></div>
Jump to details