TextContextMenuItem


A TextContextMenuComponent that represents a clickable item with a label in a context menu.

Summary

Public constructors

TextContextMenuItem(
    key: Any,
    label: String,
    leadingIcon: Int,
    onClick: TextContextMenuSession.() -> Unit
)
android

Public functions

open String
android

Public properties

String

The label text to be shown in the context menu.

android
Int

Icon that precedes the label in the context menu.

android
TextContextMenuSession.() -> Unit

The action to be performed when this item is clicked.

android

Inherited properties

From androidx.compose.foundation.text.contextmenu.data.TextContextMenuComponent
Any

A unique key that identifies this component, mainly for use in filtering a component in Modifier.filterTextContextMenuComponents.

android

Public constructors

TextContextMenuItem

TextContextMenuItem(
    key: Any,
    label: String,
    leadingIcon: Int = Resources.ID_NULL,
    onClick: TextContextMenuSession.() -> Unit
)
Parameters
key: Any

A unique key that identifies this component, mainly for use in filtering a component in Modifier.filterTextContextMenuComponents. It is advisable to use a data object as a key here.

label: String

The label text to be shown in the context menu.

leadingIcon: Int = Resources.ID_NULL

Icon that precedes the label in the context menu. This is a drawable resource reference.

onClick: TextContextMenuSession.() -> Unit

The action to be performed when this item is clicked. Call TextContextMenuSession.close on the TextContextMenuSession receiver to close the context menu item as a result of the click.

Public functions

toString

open fun toString(): String

Public properties

label

val labelString

The label text to be shown in the context menu.

leadingIcon

val leadingIconInt

Icon that precedes the label in the context menu. This is a drawable resource reference.

onClick

val onClickTextContextMenuSession.() -> Unit

The action to be performed when this item is clicked. Call TextContextMenuSession.close on the TextContextMenuSession receiver to close the context menu item as a result of the click.