---
title: "TextContextMenuItem"
description: "A [TextContextMenuComponent] that represents a clickable item with a label in a context menu."
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-android'>Android</div>


```kotlin
class TextContextMenuItem(
    key: Any,
    val label: String,
    val leadingIcon: Int = Resources.ID_NULL,
    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. |




