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


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


<h2 id="inserttextatcursor-label-action">insertTextAtCursor</h2>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun SemanticsPropertyReceiver.insertTextAtCursor(
    label: String? = null,
    action: ((AnnotatedString) -> Boolean)?,
)
```


Action to insert text into this node at the current cursor position, or replacing the selection
if text is selected.

Expected to be used on editable text fields.

#### Parameters

| | |
| --- | --- |
| label | Optional label for this action. |
| action | Action to be performed when `SemanticsActions.InsertTextAtCursor` is called. |