Skip to main content

Menu MenuItem properties

Usage

const data = [
{
type?: "menuItem",
id?: string | number,
parent?: string,
value?: string,
items?: IMenuElement[],

count?: number,
countColor?: "danger" | "secondary" | "primary" | "success", // "danger" by default
hotkey?: string,
html?: string,
icon?: string,

css?: string | string[],
disabled?: boolean, // false by default
hidden?: boolean, // false by default
}
]

Description

type(optional) the type of a control, set it to "menuItem"
id(optional) the id of a control, auto-generated if not set
parent(optional) the parent of the item
value(optional) a value for the menu item. You need to set either the value or html property to the item
items(optional) an array of children controls (note that all the children should have the type menuItem)
count(optional) a badge with a number
countColor(optional) the color of a badge with number: "danger" | "secondary" | "primary" | "success"; "danger" by default
hotkey(optional) the name of a keyboard shortcut for a menu item
html(optional) a string with HTML that should be inserted into the menu item
icon(optional) the name of an icon from the used icon font
css(optional) adds style classes
disabled(optional) defines whether an item is disabled, false by default
hidden(optional) defines whether a control is hidden, false by default

Example

Related article: MenuItem