TldrawUiMenuItem
See source codeTable of contents
Properties
disabled
Whether this item should be disabled.
disabled?: booleanicon
The icon to display on the item. Icons are only shown in certain menu types.
icon?: IconType | TLUiIconJsxiconLeft
An icon to display to the left of the menu item.
iconLeft?: IconType | TLUiIconJsxid
id: stringisSelected
Whether the item is selected.
isSelected?: booleankbd
The keyboard shortcut to display on the item.
kbd?: stringlabel
The label to display on the item. If it's a string, it will be translated. If it's an object, the keys will be used as the language keys and the values will be translated.
label?:
| {
[key: string]: TranslationKey
}
| TranslationKeynoClose
Prevent the menu from closing when the item is clicked
noClose?: booleanonDragStart
The function to call when the item is dragged. If this is provided, the item will be draggable.
Parameters
| Name | Description |
|---|---|
| |
|
Returns
voidonSelect
The function to call when the item is clicked.
Parameters
| Name | Description |
|---|---|
|
Returns
Promise<void> | voidreadonlyOk
If the editor is in readonly mode and the item is not marked as readonlyok, it will not be rendered.
readonlyOk?: booleanspinner
Whether to show a spinner on the item.
spinner?: boolean