Interface MenuItemTemplate

A template that declaratively describes one item in a menu and its logic.

Hierarchy

Index

Properties

Optional clip

clip: Clip

If specified, the menu item label will include a rendering of the contents of this clip.

Optional disabled

disabled: boolean

If true, the item will be disabled and the user will not be able to interact with it.

Optional group

group: number

If any item in an items array defines group, then all of the items in that array will be reordered automatically as follows:

  • Existing separators (null entries) will be removed.
  • The remaining items will be sorted according to their group. Any item not defining a group will use 1 000 000. This sort is stable: items in the same group stay in the same order relative to each other.
  • A separator will be inserted between any two items with a difference of at least 100 in their group values.

Optional id

id: string

An optional value that can be set to assist in implementing the menu logic. It is ignored by showMenu and does not affect any DOM ids.

Optional items

An array of templates for items that will comprise a submenu for this menu. An item with a submenu will ignore onUse; that is, clicking on the item will open the submenu rather than selecting the item. For the sake of usability, submenus may not be nested.

Optional onSelect

If defined, this function will be called when the user selects (highlights) a menu item by using the keyboard or moving the pointer over it.

Optional onUse

If defined, this function will be called when the user chooses a menu item.

Optional spokenLabel

spokenLabel: string

This is used in place of text when the menu item is read by a screen reader.

Optional text

text: string

The text that appears as a label within the menu item.

This API is still under development and is subject to change. Copyright © Math I Can Do Solutions Incorporated and/or its licensors.