CheckableItem

abstract fun CheckableItem(label: String, checked: Boolean, onCheckedChange: (Boolean) -> Unit, isEnabled: Boolean = true)

Adds a checkable item to the tray menu. This follows Compose's idiomatic pattern for stateful components.

Parameters

label

The text label for the checkable menu item.

checked

The current checked state of the item.

onCheckedChange

A lambda function called when the user toggles the item. The new checked state is passed as a parameter.

isEnabled

Determines if the checkable item is enabled. Defaults to true.


abstract fun CheckableItem(label: String, iconContent: () -> Unit, iconRenderProperties: IconRenderProperties = IconRenderProperties.forMenuItem(), checked: Boolean, onCheckedChange: (Boolean) -> Unit, isEnabled: Boolean = true)

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

Parameters

label

The text label for the checkable menu item.

iconContent

A Composable function that defines the icon.

iconRenderProperties

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

checked

The current checked state of the item.

onCheckedChange

A lambda function called when the user toggles the item.

isEnabled

Determines if the checkable item is enabled. Defaults to true.


abstract fun CheckableItem(label: String, icon: <Error class: unknown class>, iconTint: <Error class: unknown class>? = null, iconRenderProperties: IconRenderProperties = IconRenderProperties.forMenuItem(), checked: Boolean, onCheckedChange: (Boolean) -> Unit, isEnabled: Boolean = true)

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

Parameters

label

The text label for the checkable 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.

checked

The current checked state of the item.

onCheckedChange

A lambda function called when the user toggles the item.

isEnabled

Determines if the checkable item is enabled. Defaults to true.


abstract fun CheckableItem(label: String, icon: <Error class: unknown class>, iconRenderProperties: IconRenderProperties = IconRenderProperties.forMenuItem(), checked: Boolean, onCheckedChange: (Boolean) -> Unit, isEnabled: Boolean = true)

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

Parameters

label

The text label for the checkable menu item.

icon

The Painter to display as icon.

iconRenderProperties

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

checked

The current checked state of the item.

onCheckedChange

A lambda function called when the user toggles the item.

isEnabled

Determines if the checkable item is enabled. Defaults to true.


abstract fun CheckableItem(label: String, icon: <Error class: unknown class>, iconRenderProperties: IconRenderProperties = IconRenderProperties.forMenuItem(), checked: Boolean, onCheckedChange: (Boolean) -> Unit, isEnabled: Boolean = true)

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


open fun CheckableItem(label: String, checked: Boolean = false, isEnabled: Boolean = true, onToggle: (Boolean) -> Unit)

Deprecated

Use CheckableItem with separate checked and onCheckedChange parameters

Replace with

CheckableItem(label, checked, onCheckedChange, isEnabled)

Adds a checkable item to the tray menu with the legacy API.