# androidx.a2ui.compose.ui

## Interfaces

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiCatalog` | A Jetpack Compose implementation of an A2UI component catalog, which defines which `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponent`s and `https://developer.android.com/reference/kotlin/androidx/a2ui/model/catalog/A2uiFunction`s are available to the agent for a particular A2UI surface. |
| `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponent` | Defines the schema and Jetpack Compose rendering implementation for a single A2UI component. |
| `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponentCollection` | An immutable, indexed collection of `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponent`s registered within an `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiCatalog`. |

## Composables

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponent.composable` | Emits the UI for a successfully resolved A2UI component state into the Compose hierarchy. |

## Top-level functions summary

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiCatalog` | `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/package-summary#A2uiCatalog(kotlin.String,kotlin.collections.List,kotlin.collections.List,androidx.a2ui.model.schema.A2uiSchema,kotlin.Boolean)( catalogId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, components: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponent>, functions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/a2ui/model/catalog/A2uiFunction>, themeSchema: https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchema?, isInline: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Creates a new, immutable `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/package-summary#A2uiCatalog(kotlin.String,kotlin.collections.List,kotlin.collections.List,androidx.a2ui.model.schema.A2uiSchema,kotlin.Boolean)` mapping a list of `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponent`s and `https://developer.android.com/reference/kotlin/androidx/a2ui/model/catalog/A2uiFunction`s to their respective protocol definitions. |
| `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponentCollection` | `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/package-summary#A2uiComponentCollection(kotlin.collections.List)(components: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponent>)` Creates an immutable `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/package-summary#A2uiComponentCollection(kotlin.collections.List)` from a list of `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponent`s. |
| `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiMessageProcessor` | `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/package-summary#A2uiMessageProcessor(kotlin.collections.List,kotlin.collections.List)( catalogs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiCatalog>, interceptors: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiActionInterceptor> )` Creates a `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/package-summary#A2uiMessageProcessor(kotlin.collections.List,kotlin.collections.List)` configured for Jetpack Compose UI. |

## Extension functions summary

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiReadinessEvaluator` | `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiCatalog.https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/package-summary#(androidx.a2ui.compose.ui.A2uiCatalog).asReadinessEvaluator()()` Creates an `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiReadinessEvaluator` that resolves readiness states using the components registered in this catalog. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>` | `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiCatalog.https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/package-summary#(androidx.a2ui.compose.ui.A2uiCatalog).toJsonSchemaMap()()` Serializes this catalog to its JSON Schema Map representation. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiCatalog.https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/package-summary#(androidx.a2ui.compose.ui.A2uiCatalog).toJsonSchemaString()()` Serializes this catalog to its JSON Schema string representation. |

## Top-level functions

### A2uiCatalog

Artifact: [androidx.a2ui.compose:compose-ui](https://developer.android.com/jetpack/androidx/releases/a2ui-compose) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/compose/ui/A2uiCatalog.kt+function:A2uiCatalog)

```
fun A2uiCatalog(
    catalogId: String,
    components: List<A2uiComponent>,
    functions: List<A2uiFunction> = emptyList(),
    themeSchema: A2uiSchema? = null,
    isInline: Boolean = false
): A2uiCatalog
```

Creates a new, immutable `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/package-summary#A2uiCatalog(kotlin.String,kotlin.collections.List,kotlin.collections.List,androidx.a2ui.model.schema.A2uiSchema,kotlin.Boolean)` mapping a list of `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponent`s and `https://developer.android.com/reference/kotlin/androidx/a2ui/model/catalog/A2uiFunction`s to their respective protocol definitions.

| Parameters |
|---|---|
| `catalogId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The unique identifier for this catalog. |
| `components: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponent>` | The list of `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponent` implementations supported by this catalog. |
| `functions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/a2ui/model/catalog/A2uiFunction> = emptyList()` | The optional list of `https://developer.android.com/reference/kotlin/androidx/a2ui/model/catalog/A2uiFunction`s supported by this catalog. Defaults to an empty list. |
| `themeSchema: https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchema? = null` | An optional `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchema` defining the dynamic theme overrides. Defaults to null. |
| `isInline: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | Indicates whether this catalog's full JSON Schema should be serialized inline. Defaults to false. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiCatalog` | A fully initialized and validated `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/package-summary#A2uiCatalog(kotlin.String,kotlin.collections.List,kotlin.collections.List,androidx.a2ui.model.schema.A2uiSchema,kotlin.Boolean)`. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | If duplicate component names or duplicate function names are detected. |

### A2uiComponentCollection

Artifact: [androidx.a2ui.compose:compose-ui](https://developer.android.com/jetpack/androidx/releases/a2ui-compose) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/compose/ui/A2uiComponentCollection.kt+function:A2uiComponentCollection)

```
fun A2uiComponentCollection(components: List<A2uiComponent> = emptyList()): A2uiComponentCollection
```

Creates an immutable `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/package-summary#A2uiComponentCollection(kotlin.collections.List)` from a list of `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponent`s.

| Parameters |
|---|---|
| `components: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponent> = emptyList()` | The list of components to include. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponentCollection` | An initialized `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/package-summary#A2uiComponentCollection(kotlin.collections.List)`. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | If duplicate component names are detected. |

### A2uiMessageProcessor

Artifact: [androidx.a2ui.compose:compose-ui](https://developer.android.com/jetpack/androidx/releases/a2ui-compose) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/compose/ui/A2uiMessageProcessor.kt+function:A2uiMessageProcessor)

```
fun A2uiMessageProcessor(
    catalogs: List<A2uiCatalog>,
    interceptors: List<A2uiActionInterceptor> = emptyList()
): A2uiMessageProcessor
```

Creates a `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/package-summary#A2uiMessageProcessor(kotlin.collections.List,kotlin.collections.List)` configured for Jetpack Compose UI.

This provisions the underlying core processor with a Compose-backed component registry and reactive data model that leverage the Compose Snapshot state.

| Parameters |
|---|---|
| `catalogs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiCatalog>` | The list of component catalogs supported by the client. |
| `interceptors: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiActionInterceptor> = emptyList()` | An optional list of core `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiActionInterceptor`s to process actions. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiMessageProcessor` | A fully initialized `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/package-summary#A2uiMessageProcessor(kotlin.collections.List,kotlin.collections.List)`. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | If any catalog in the `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/package-summary#A2uiMessageProcessor(kotlin.collections.List,kotlin.collections.List)` list does not implement the `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiRuntimeCatalog` interface. |

## Extension functions

### A2uiCatalog.asReadinessEvaluator

Artifact: [androidx.a2ui.compose:compose-ui](https://developer.android.com/jetpack/androidx/releases/a2ui-compose) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/compose/ui/A2uiCatalog.kt+function:asReadinessEvaluator) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui-compose#1.0.0-alpha02)

```
fun A2uiCatalog.asReadinessEvaluator(): A2uiReadinessEvaluator
```

Creates an `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiReadinessEvaluator` that resolves readiness states using the components registered in this catalog.

This evaluator delegates to each specific `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/A2uiComponent#(androidx.a2ui.compose.runtime.A2uiComponentScope).isReady(androidx.a2ui.compose.runtime.A2uiComponentProperties)` implementation to determine if a component is ready to transition from a loading state to a success state (e.g., has loaded all its required dynamic data).

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiReadinessEvaluator` | An `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiReadinessEvaluator` backed by this catalog. |

### A2uiCatalog.toJsonSchemaMap

Artifact: [androidx.a2ui.compose:compose-ui](https://developer.android.com/jetpack/androidx/releases/a2ui-compose) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/compose/ui/A2uiCatalog.kt+function:toJsonSchemaMap) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui-compose#1.0.0-alpha02)

```
fun A2uiCatalog.toJsonSchemaMap(): Map<String, Any?>
```

Serializes this catalog to its JSON Schema Map representation.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>` | the serialized catalog JSON Schema Map |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | If this catalog does not support serialization. |

### A2uiCatalog.toJsonSchemaString

Artifact: [androidx.a2ui.compose:compose-ui](https://developer.android.com/jetpack/androidx/releases/a2ui-compose) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/compose/ui/A2uiCatalog.kt+function:toJsonSchemaString) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui-compose#1.0.0-alpha02)

```
fun A2uiCatalog.toJsonSchemaString(): String
```

Serializes this catalog to its JSON Schema string representation.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the serialized catalog JSON Schema string |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | If this catalog does not support serialization. |