A2UICatalog

How each component type of a surface looks, by type, such as Text.

Basic draws every component of the A2UI 1.0 basic catalog. Start from it to draw a type your own way; the agent still writes the type as the catalog describes it:

val catalog = A2UICatalog.Basic.with("Card") { scope ->
BrandCard(modifier = scope.modifier) { scope.child()?.let { scope.Child(it) } }
}

To keep the agent from using a type, remove it with removing. The agent is told about the basic catalog's types the catalog draws, and a type the catalog has no renderer for shows nothing.

Parameters

renderers

The renderer of each type.

Constructors

Link copied to clipboard
constructor(renderers: Map<String, A2UIComponentRenderer>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
operator fun get(type: String): A2UIComponentRenderer?

The renderer of type, or null when the catalog has none.

Link copied to clipboard
operator fun plus(other: A2UICatalog): A2UICatalog

A catalog with the renderers of both; the ones of other win.

Link copied to clipboard
fun removing(vararg types: String): A2UICatalog

A copy without types, such as Video. The agent isn't told about a removed type of the basic catalog, and a reply that still uses one shows nothing for it, as for a type no catalog has.

Link copied to clipboard

A copy that draws type with renderer.