How to change Text's contentDescription on JetpackCompose

Viewed 1452

How can I change the default Text content description to be read on TalkBack on Jetpack Compose to any text that I want ?

1 Answers

As described in the accessibility documentation you can use the semantics modifier.
You can use the contentDescription semantic property to set a custom content description:

Text("First text", modifier = Modifier.semantics {
    this.contentDescription = "Custom content description" }
)
Related