---
title: "insertTextAtCursor"
description: "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."
type: "function"
---

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


<a id='references'></a>
<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. |




