Class

TextContextMenuItem

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

Source set: Android
public class TextContextMenuItem(
    key: Any,
    public val label: String,
    public val leadingIcon: Int = Resources.ID_NULL,
    public val onClick: TextContextMenuSession.() -> Unit,
) : TextContextMenuComponent(key)

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

Parameters

key 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 The label text to be shown in the context menu.
leadingIcon Icon that precedes the label in the context menu. This is a drawable resource reference.
onClick 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.

Functions

toString

Source set: Android
override fun toString(): String
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: