Skip to content

MenuItem

Defined in: menu.svelte.ts:23

readonly [MENU_ITEM_TAG]: true = true

Defined in: menu.svelte.ts:24


readonly menu: Menu

Defined in: menu.svelte.ts:75

get checked(): boolean | null

Defined in: menu.svelte.ts:50

boolean | null


get disabled(): boolean

Defined in: menu.svelte.ts:54

boolean


get icon(): string | null

Defined in: menu.svelte.ts:46

string | null


get isLabel(): boolean

Defined in: menu.svelte.ts:58

boolean


get section(): string

Defined in: menu.svelte.ts:38

string


get title(): string | DocumentFragment

Defined in: menu.svelte.ts:42

string | DocumentFragment

click(evt): any

Defined in: menu.svelte.ts:62

MouseEvent | KeyboardEvent

any


onClick(callback): this

Defined in: menu.svelte.ts:115

(evt) => any

this


setChecked(checked): this

Defined in: menu.svelte.ts:94

boolean | null

this


setDisabled(disabled): this

Defined in: menu.svelte.ts:99

boolean

this


setIcon(icon): this

Defined in: menu.svelte.ts:88

string | null

ID of the icon, can use any icon loaded with addIcon or from the built-in lucide library.

this

The Obsidian icon library includes the Lucide icon library, any icon name from their site will work here.


setIsLabel(isLabel): this

Defined in: menu.svelte.ts:109

boolean

this


setSection(section): this

Defined in: menu.svelte.ts:130

Sets the section this menu item should belong in. To find the section IDs of an existing menu, inspect the DOM elements to see their data-section attribute.

string

this


setTitle(title): this

Defined in: menu.svelte.ts:78

string | DocumentFragment

this


setWarning(warning?): this

Defined in: menu.svelte.ts:104

boolean = true

this


static create(menu): MenuItem

Defined in: menu.svelte.ts:66

Menu

MenuItem