# SemanticsKt

Added in 1.3.0

*** ** * ** ***


```
public final class SemanticsKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier` | `https://developer.android.com/reference/androidx/wear/protolayout/modifiers/SemanticsKt#(androidx.wear.protolayout.modifiers.LayoutModifier).clearSemantics()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier receiver)` Clears the semantics, including `https://developer.android.com/reference/androidx/wear/protolayout/modifiers/package-summary#(androidx.wear.protolayout.modifiers.LayoutModifier).contentDescription(kotlin.String,androidx.wear.protolayout.expression.DynamicBuilders.DynamicString)` and `https://developer.android.com/reference/androidx/wear/protolayout/modifiers/package-summary#(androidx.wear.protolayout.modifiers.LayoutModifier).semanticsRole(kotlin.Int)`, from the modifier. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier` | `https://developer.android.com/reference/androidx/wear/protolayout/modifiers/SemanticsKt#(androidx.wear.protolayout.modifiers.LayoutModifier).contentDescription(kotlin.String,androidx.wear.protolayout.expression.DynamicBuilders.DynamicString)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html staticValue, @https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicString dynamicValue )` Adds content description to be read by accessibility services. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 600) https://developer.android.com/reference/androidx/wear/protolayout/modifiers/SemanticsKt#(androidx.wear.protolayout.modifiers.LayoutModifier).semanticsHeading(kotlin.Boolean)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier receiver, boolean heading)` Mark the element as heading for a section of content for accessibility purpose. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier` | `https://developer.android.com/reference/androidx/wear/protolayout/modifiers/SemanticsKt#(androidx.wear.protolayout.modifiers.LayoutModifier).semanticsRole(kotlin.Int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier receiver, int semanticsRole)` Adds the semantic role of user interface element. |

## Public methods

### clearSemantics

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Semantics.kt+function:clearSemantics) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.3.0)

```
public static final @NonNull LayoutModifier clearSemantics(@NonNull LayoutModifier receiver)
```

Clears the semantics, including `https://developer.android.com/reference/androidx/wear/protolayout/modifiers/package-summary#(androidx.wear.protolayout.modifiers.LayoutModifier).contentDescription(kotlin.String,androidx.wear.protolayout.expression.DynamicBuilders.DynamicString)` and `https://developer.android.com/reference/androidx/wear/protolayout/modifiers/package-summary#(androidx.wear.protolayout.modifiers.LayoutModifier).semanticsRole(kotlin.Int)`, from the modifier.

### contentDescription

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Semantics.kt+function:contentDescription) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.3.0)

```
public static final @NonNull LayoutModifier contentDescription(
    @NonNull LayoutModifier receiver,
    @NonNull String staticValue,
    @RequiresSchemaVersion(major = 1, minor = 200) DynamicBuilders.DynamicString dynamicValue
)
```

Adds content description to be read by accessibility services.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html staticValue` | The static content description. This value will be used if `https://developer.android.com/reference/androidx/wear/protolayout/modifiers/package-summary#(androidx.wear.protolayout.modifiers.LayoutModifier).contentDescription(kotlin.String,androidx.wear.protolayout.expression.DynamicBuilders.DynamicString)` is null, or if can't be resolved. |
| `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicString dynamicValue` | The dynamic content description. This is useful when content of the element itself is dynamic. |

### semanticsHeading

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Semantics.kt+function:semanticsHeading) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
@RequiresSchemaVersion(major = 1, minor = 600)
public static final @NonNull LayoutModifier semanticsHeading(@NonNull LayoutModifier receiver, boolean heading)
```

Mark the element as heading for a section of content for accessibility purpose.

### semanticsRole

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Semantics.kt+function:semanticsRole) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.3.0)

```
public static final @NonNull LayoutModifier semanticsRole(@NonNull LayoutModifier receiver, int semanticsRole)
```

Adds the semantic role of user interface element. Accessibility services might use this to describe the element or do customizations.