Both menu bar and submenu items can be marked as disabled by setting the disabled property on
the item object. Disabled items are excluded from the keyboard navigation. Clicking disabled item does not
select it, and neither closes nor opens submenu.
When updating menu bar items dynamically, including changing any property on the item object
corresponding to one of the menu bar buttons, call render() method on the menu bar component
instance to recreate the buttons based on updated items.
Selected item:
Submenu items can be configured to show a selection checkmark using the checked property.
This does not apply to menu bar buttons. Checked state is expected to be toggled by the user. You don't
have to call render() after toggling checked property.
Note, the checkable flag used in the example below is there just for the demo
and is not part of the items API.
Selected item:
Item objects corresponding to menu bar buttons support the component property.
It accepts two different types of values:
Same API also applies to submenu. In addition, <hr> component
can be used to create a separator between submenu items.
Selected item: