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


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


<h2 id="settextsubstitution-label-action">setTextSubstitution</h2>

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


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


Action to set the text substitution of this node.

Expected to be used on non-editable text.

Note, this action doesn't show the text substitution. Please call
`SemanticsPropertyReceiver.showTextSubstitution` to show the text substitution.

#### Parameters

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