We just launched Compose Examples featuring over 150+ components! Check it out →

clearAndSetSemantics

Common

Modifier in Compose Ui

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.8.0-alpha01")
}

Overloads


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

Parameters

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