---
title: "AutofillTree"
description: "The autofill tree is a temporary data structure that is used before the Semantics Tree is
implemented. This data structure is used by compose components to set autofill hints (via
[AutofillNode]s). It is also used by the autofill framework to communicate with Compose
components (by calling [performAutofill]).

The [AutofillTree] will be replaced by Autofill Semantics (b/138604305).

Since this is a temporary implementation, it is implemented as a list of [children], which is
essentially a tree of height = 1"
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


> **Deprecated** " Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead. "

```kotlin
class AutofillTree
```


The autofill tree is a temporary data structure that is used before the Semantics Tree is
implemented. This data structure is used by compose components to set autofill hints (via
`AutofillNode`s). It is also used by the autofill framework to communicate with Compose
components (by calling `performAutofill`).

The `AutofillTree` will be replaced by Autofill Semantics (b/138604305).

Since this is a temporary implementation, it is implemented as a list of `children`, which is
essentially a tree of height = 1


## Properties

<div class='sourceset sourceset-common'>Common</div>


```kotlin
val children: MutableMap<Int, @Suppress("Deprecation") AutofillNode>
```


A map which contains `AutofillNode`s, where every node represents an autofill-able field.



## Functions

```kotlin
operator fun plusAssign(autofillNode: @Suppress("Deprecation") AutofillNode)
```


Add the specified `AutofillNode` to the `AutofillTree`.


```kotlin
fun performAutofill(id: Int, value: String) = children[id]?.onFill?.invoke(value)
```


The autofill framework uses this function to 'fill' the `AutofillNode` represented by `id`
with the specified `value`.



