# AutofillNode

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/autofill/Autofill.kt+class:androidx.compose.ui.autofill.AutofillNode) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0) Common/AllAndroid/JVM
- Cmn

  ```
  class AutofillNode
  ```

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

Every autofill-able composable will have an `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode`. (An autofill node will be created for every semantics node that adds autofill properties). This node is used to request/cancel autofill, and it holds the `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode#onFill()` lambda which is called by the autofill framework.

## Summary

| ### Public constructors |
|---|---|
| `[AutofillNode](https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode#AutofillNode(kotlin.collections.List,androidx.compose.ui.geometry.Rect,kotlin.Function1))( autofillTypes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillType>, boundingBox: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect?, onFill: ((https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? )` **This function is deprecated.** Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead. | Cmn |

| ### Public functions |
|---|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[equals](https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode#equals(kotlin.Any))(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` **This function is deprecated.** Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[hashCode](https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode#hashCode())()` **This function is deprecated.** Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead. | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillType>` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode#autofillTypes()` **This property is deprecated.** Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode#boundingBox()` **This property is deprecated.** Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode#id()` **This property is deprecated.** Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead. | Cmn |
| `((https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode#onFill()` **This property is deprecated.** Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead. | Cmn |

## Public constructors

### AutofillNode

Cmn

```
[AutofillNode](https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode#AutofillNode(kotlin.collections.List,androidx.compose.ui.geometry.Rect,kotlin.Function1))(
    autofillTypes: List<AutofillType> = listOf(),
    boundingBox: Rect? = null,
    onFill: ((String) -> Unit)?
)
```

> [!CAUTION]
> **This function is deprecated.**   
> Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

## Public functions

### equals

Cmn

```
open operator fun [equals](https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode#equals(kotlin.Any))(other: Any?): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

### hashCode

Cmn

```
open fun [hashCode](https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode#hashCode())(): Int
```

> [!CAUTION]
> **This function is deprecated.**   
> Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

## Public properties

### autofillTypes

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

```
val autofillTypes: List<AutofillType>
```

> [!CAUTION]
> **This property is deprecated.**   
> Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

A list of autofill types for this node. These types are conveyed to the autofill framework and it is used to call `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode#onFill()` with the appropriate value. If you don't set this property, the autofill framework will use heuristics to guess the type. This property is a list because some fields can have multiple types. For instance, userid in a login form can either be a username or an email address. TODO(b/138731416): Check with the autofill service team if the order matters, and how duplicate types are handled.

### boundingBox

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

```
var boundingBox: Rect?
```

> [!CAUTION]
> **This property is deprecated.**   
> Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

The screen coordinates of the composable being auto-filled. This data is used by the autofill framework to decide where to show the autofill popup.

### id

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

```
val id: Int
```

> [!CAUTION]
> **This property is deprecated.**   
> Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

A virtual id that is automatically generated for each node.

### onFill

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

```
val onFill: ((String) -> Unit)?
```

> [!CAUTION]
> **This property is deprecated.**   
> Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

The callback that is called by the autofill framework to perform autofill.