---
title: "setText"
description: "Action to set the text contents of this node.

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.setText(
    label: String? = null,
    action: ((AnnotatedString) -> Boolean)?,
)
```


Action to set the text contents of this node.

Expected to be used on editable text fields.

#### Parameters

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




