New Compose Multiplatform components arrived on Composables UICheck it out →

Modifier in Compose Ui

clearAndSetSemantics

Common

Clears the semantics of all the descendant nodes and sets new semantics.

In the merged semantics tree, this clears the semantic information provided by the node's descendants (but not those of the layout node itself, if any) and sets the provided semantics. (In the unmerged tree, the semantics node is marked with "[SemanticsConfiguration.isClearingSemantics]", but nothing is actually cleared.)

Last updated:

Installation

dependencies {
   implementation("androidx.compose.ui:ui:1.7.0-beta04")
}

Overloads


fun Modifier.clearAndSetSemantics(
    properties: (SemanticsPropertyReceiver.() -> Unit)
)

Parameters

namedescription
propertiesproperties to add to the semantics. [SemanticsPropertyReceiver] will be provided in the scope to allow access for common properties and its values.