PlainMenuButton

MenuButton component in the Plain reference design system

API

Class hierarchy:

The element defines the following shadow parts:

  • down-icon: the icon shown in the toggle if the popup will open or close in the down direction
  • menu: the menu shown in the popup, default type is PlainMenu
  • popup: default type is PlainPopup
  • popup-toggle: the element that lets the user know they can open the popup, default type is PlainOpenCloseToggle
  • source: default type is PlainBorderButton
  • up-icon: the icon shown in the toggle if the popup will open or close in the up direction

highlightSelectedItemAndClose() method

Highlight the selected item (if one exists), then close the menu.

Defined by MenuButton

itemSelected(item) method

Invoked when a new item is selected.

Parameters:

  • item: HTMLElement|SVGElement

Defined by MenuButton

menu-item-selected event

Raised when the user has moved the selection to a new menu item. This event is raised while the menu is still open. To check which item the user selected from a menu, listen to the closed event and inspect the event details object for its closeResult member.

Defined by MenuButton

menuPartType property

The class or tag used to define the menu part – the element presenting the menu items and handling navigation between them.

Type: (component class constructor)|HTMLTemplateElement|string

Default: Menu

Defined by MenuButton

popupTogglePartType property

The class or tag used to create the popup-toggle part – the element that lets the user know they can open the popup.

Type: (component class constructor)|HTMLTemplateElement|string

Default: UpDownToggle

Defined by MenuButton