Item

abstract fun Item(label: String, isEnabled: Boolean = true, onClick: () -> Unit = {})

Adds an item to the tray menu.

Parameters

label

The text label for the menu item.

isEnabled

Indicates whether the menu item is enabled. Defaults to true.

onClick

Lambda function to be invoked when the menu item is clicked. Defaults to an empty lambda.


abstract fun Item(label: String, iconContent: () -> Unit, iconRenderProperties: IconRenderProperties = IconRenderProperties.forMenuItem(), isEnabled: Boolean = true, onClick: () -> Unit = {})

Adds an item to the tray menu with a Composable icon.

Parameters

label

The text label for the menu item.

iconContent

A Composable function that defines the icon.

iconRenderProperties

Properties for rendering the icon. Defaults to 16x16 for menu items.

isEnabled

Indicates whether the menu item is enabled. Defaults to true.

onClick

Lambda function to be invoked when the menu item is clicked. Defaults to an empty lambda.


abstract fun Item(label: String, icon: <Error class: unknown class>, iconTint: <Error class: unknown class>? = null, iconRenderProperties: IconRenderProperties = IconRenderProperties.forMenuItem(), isEnabled: Boolean = true, onClick: () -> Unit = {})

Adds an item to the tray menu with an ImageVector icon.

Parameters

label

The text label for the menu item.

icon

The ImageVector to display as icon.

iconTint

Optional tint color for the icon. If null, adapts to menu theme.

iconRenderProperties

Properties for rendering the icon. Defaults to 16x16 for menu items.

isEnabled

Indicates whether the menu item is enabled. Defaults to true.

onClick

Lambda function to be invoked when the menu item is clicked. Defaults to an empty lambda.


abstract fun Item(label: String, icon: <Error class: unknown class>, iconRenderProperties: IconRenderProperties = IconRenderProperties.forMenuItem(), isEnabled: Boolean = true, onClick: () -> Unit = {})

Adds an item to the tray menu with a Painter icon.

Parameters

label

The text label for the menu item.

icon

The Painter to display as icon.

iconRenderProperties

Properties for rendering the icon. Defaults to 16x16 for menu items.

isEnabled

Indicates whether the menu item is enabled. Defaults to true.

onClick

Lambda function to be invoked when the menu item is clicked. Defaults to an empty lambda.


abstract fun Item(label: String, icon: <Error class: unknown class>, iconRenderProperties: IconRenderProperties = IconRenderProperties.forMenuItem(), isEnabled: Boolean = true, onClick: () -> Unit = {})

Adds an item to the tray menu with a DrawableResource icon. This allows calling code like: Item(label, icon = Res.drawable.icon, ...)