# SemanticsNode

Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/semantics/SemanticsNode.kt+class:androidx.compose.ui.semantics.SemanticsNode) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  class SemanticsNode
  ```

*** ** * ** ***

A list of key/value pairs associated with a layout node or its subtree.

Each SemanticsNode takes its id and initial key/value list from the outermost modifier on one layout node. It also contains the "collapsed" configuration of any other semantics modifiers on the same layout node, and if "mergeDescendants" is specified and enabled, also the "merged" configuration of its subtree.

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#computeEffectiveAlpha()()` Returns the effective composite alpha (opacity) of this node, computed by resolving the product of this node's layer alpha and all ancestor layer alphas. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#getAlignmentLinePosition(androidx.compose.ui.layout.AlignmentLine)(alignmentLine: https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/AlignmentLine)` Returns the position of an `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/AlignmentLine`, or `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/AlignmentLine#Unspecified()` if the line is not provided. | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#boundsInRoot()` The bounding box for this node relative to the root of this Compose hierarchy, with clipping applied. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#boundsInWindow()` The bounding box for this node relative to the window, with clipping applied. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode>` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#children()` Contains the children in inverse hit test order (i.e. paint order). | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsConfiguration` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#config()` The list of semantics properties of this node. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#id()` For newer AccessibilityNodeInfo-based integration test frameworks, it can be matched in the extras with key "androidx.compose.ui.semantics.id" | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#isRoot()` Whether this SemanticNode is the root of a tree or not | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/LayoutInfo` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#layoutInfo()` The `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/LayoutInfo` that this is associated with. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#mergingEnabled()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#parent()` The parent of this node in the tree. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#positionInRoot()` The position of this node relative to the root of this Compose hierarchy, with no clipping applied | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#positionInWindow()` The position of this node relative to the window, with no clipping applied | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#positionOnScreen()` The position of this node relative to the screen, with no clipping applied | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/node/RootForTest?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#root()` The `https://developer.android.com/reference/kotlin/androidx/compose/ui/node/RootForTest` this node is attached to. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#size()` The size of the bounding box for this node, with no clipping applied | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#touchBoundsInRoot()` The rectangle of the touchable area. | Cmn |

## Public functions

### computeEffectiveAlpha

Cmn Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
fun computeEffectiveAlpha(): Float
```

Returns the effective composite alpha (opacity) of this node, computed by resolving the product of this node's layer alpha and all ancestor layer alphas.

### getAlignmentLinePosition

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun getAlignmentLinePosition(alignmentLine: AlignmentLine): Int
```

Returns the position of an `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/AlignmentLine`, or `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/AlignmentLine#Unspecified()` if the line is not provided.

## Public properties

### boundsInRoot

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val boundsInRoot: Rect
```

The bounding box for this node relative to the root of this Compose hierarchy, with clipping applied. To get the bounds with no clipping applied, use Rect(`https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#positionInRoot()`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#size()`.toSize())

### boundsInWindow

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val boundsInWindow: Rect
```

The bounding box for this node relative to the window, with clipping applied. To get the bounds with no clipping applied, use PxBounds(`https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#positionInWindow()`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#size()`.toSize())

### children

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val children: List<SemanticsNode>
```

Contains the children in inverse hit test order (i.e. paint order).

Note that if mergingEnabled and mergeDescendants are both true, then there are no children (except those that are themselves mergeDescendants).

### config

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val config: SemanticsConfiguration
```

The list of semantics properties of this node.

This includes all properties attached as modifiers to the current layout node. In addition, if mergeDescendants and mergingEnabled are both true, then it also includes the semantics properties of descendant nodes.

### id

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val id: Int
```

For newer AccessibilityNodeInfo-based integration test frameworks, it can be matched in the extras with key "androidx.compose.ui.semantics.id"

### isRoot

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val isRoot: Boolean
```

Whether this SemanticNode is the root of a tree or not

### layoutInfo

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val layoutInfo: LayoutInfo
```

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/LayoutInfo` that this is associated with.

### mergingEnabled

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val mergingEnabled: Boolean
```

### parent

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val parent: SemanticsNode?
```

The parent of this node in the tree.

### positionInRoot

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val positionInRoot: Offset
```

The position of this node relative to the root of this Compose hierarchy, with no clipping applied

### positionInWindow

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val positionInWindow: Offset
```

The position of this node relative to the window, with no clipping applied

### positionOnScreen

Cmn Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.7.0)

```
val positionOnScreen: Offset
```

The position of this node relative to the screen, with no clipping applied

### root

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val root: RootForTest?
```

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/node/RootForTest` this node is attached to.

### size

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val size: IntSize
```

The size of the bounding box for this node, with no clipping applied

### touchBoundsInRoot

Cmn Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.1.0)

```
val touchBoundsInRoot: Rect
```

The rectangle of the touchable area.

If this is a clickable region, this is the rectangle that accepts touch input. This can be larger than `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode#size()` when the layout is less than `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/ViewConfiguration#minimumTouchTargetSize()`