Skip to content

@tavora/sdk / MenuEntry

Type Alias: MenuEntry ​

MenuEntry = { checked?: boolean; color?: string; danger?: boolean; disabled?: boolean; hint?: string; id: string; label: string; radio?: boolean; type: "item"; } | { type: "separator"; } | { label: string; type: "heading"; } | { color?: string; disabled?: boolean; items: MenuEntry[]; label: string; type: "submenu"; }

Defined in: packages/sdk/src/protocol.ts:1153

One entry of a menu drawn by Tavora (ui.showMenu). Text only; Tavora draws it in the current theme. An item list where any item sets checked keeps a column for the mark, so labels line up.

Union Members ​

Type Literal ​

{ checked?: boolean; color?: string; danger?: boolean; disabled?: boolean; hint?: string; id: string; label: string; radio?: boolean; type: "item"; }

checked? ​

optional checked?: boolean

Shows a check mark (or a dot, with radio) when true, and keeps the mark's column when false.

color? ​

optional color?: string

A colour dot before the label, as a CSS colour: #rgb, #rrggbb, rgb(), hsl(), oklch() and the like, or transparent for an empty ring.

danger? ​

optional danger?: boolean

Red, for something that deletes or cannot be undone.

disabled? ​

optional disabled?: boolean

hint? ​

optional hint?: string

Small grey text on the right, such as a shortcut ("Ctrl+D").

id ​

id: string

Returned when the user picks it; unique within the menu, at most 64 characters.

label ​

label: string

radio? ​

optional radio?: boolean

The mark is a dot: one choice of several.

type ​

type: "item"


Type Literal ​

{ type: "separator"; }


Type Literal ​

{ label: string; type: "heading"; }


Type Literal ​

{ color?: string; disabled?: boolean; items: MenuEntry[]; label: string; type: "submenu"; }

color? ​

optional color?: string

disabled? ​

optional disabled?: boolean

items ​

items: MenuEntry[]

Items, separators and headings; a submenu holds no further submenus.

label ​

label: string

type ​

type: "submenu"

For Tavora 0.23.9 and @tavora/sdk 0.3.3. Code under the MIT License. The Tavora name and logo are not covered by it.