DocsRenderA2UIComponent Catalog

Component Catalog

The built-in A2UI catalog provides 18 Angular components covering display, layout, interactive controls, media, and advanced inputs. Pass a2uiBasicCatalog() to the ChatComponent views input to enable A2UI rendering, or instantiate it directly for custom setups.

Import:

import { a2uiBasicCatalog } from '@ngaf/chat';

Signature

function a2uiBasicCatalog(): ViewRegistry

Returns a ViewRegistry mapping 18 A2UI type names to their Angular component implementations. Pass the result to A2uiSurfaceComponent or use it as a starting point for a custom registry.

const catalog = a2uiBasicCatalog();

Display Components

Text

Renders a span of text.

A2UI typeAngular componentSelector
TextA2uiTextComponenta2ui-text
PropTypeDescription
textstringThe text content to display
{"id": "greeting", "component": "Text", "text": "Hello, world!"}

Image

Renders an <img> element.

A2UI typeAngular componentSelector
ImageA2uiImageComponenta2ui-image
PropTypeDescription
urlstringImage source URL
altstringAlt text for accessibility

Icon

Renders an icon glyph as a text span. The name prop is displayed directly — use an emoji or a Unicode symbol.

A2UI typeAngular componentSelector
IconA2uiIconComponenta2ui-icon
PropTypeDescription
namestringGlyph to render (e.g., "✓", "⚠️")

Divider

Renders a horizontal rule. Has no props.

A2UI typeAngular componentSelector
DividerA2uiDividerComponenta2ui-divider

Layout Components

Layout components receive childKeys — an array of component IDs — and render each child via json-render's RenderElementComponent. They also receive the full spec so that child elements can be looked up by key.

Row

Arranges children horizontally with a flex row layout.

A2UI typeAngular componentSelector
RowA2uiRowComponenta2ui-row
PropTypeDescription
childKeysstring[]Ordered list of child component IDs
specSpecInjected automatically by the render engine

Column

Arranges children vertically with a flex column layout.

A2UI typeAngular componentSelector
ColumnA2uiColumnComponenta2ui-column
PropTypeDescription
childKeysstring[]Ordered list of child component IDs
specSpecInjected automatically by the render engine

Card

Renders children inside a rounded bordered card container with an optional title.

A2UI typeAngular componentSelector
CardA2uiCardComponenta2ui-card
PropTypeDescription
titlestringOptional card heading
childKeysstring[]Ordered list of child component IDs
specSpecInjected automatically by the render engine

List

Renders children in a scrollable vertical list (max height 24rem).

A2UI typeAngular componentSelector
ListA2uiListComponenta2ui-list
PropTypeDescription
childKeysstring[]Ordered list of child component IDs
specSpecInjected automatically by the render engine
Template children

For data-driven lists, use the A2uiChildTemplate form instead of static childKeys. Set children to {"path": "/items", "componentId": "item-template"} and the surface component will expand the template once per array item. See the Surface Component page for details.

Interactive Components

Interactive components support two-way data binding and button actions. They receive two special injected props:

  • _bindings — a Record<string, string> auto-populated by surfaceToSpec() from path references in the component definition. Maps prop names to JSON Pointer paths. When the user changes a bound value, the component emits an a2ui:datamodel: event. Agents do not write _bindings directly — they use path references (e.g., {"path": "/name"}) and the render pipeline extracts bindings automatically.
  • emit — injected by the render engine; components call it to dispatch events back to the chat.

Button

Renders a button that dispatches an action when clicked.

A2UI typeAngular componentSelector
ButtonA2uiButtonComponenta2ui-button
PropTypeDescription
labelstringButton label text
variant'primary' | 'borderless'Visual style. Defaults to 'primary'
disabledbooleanDisables the button when true
actionA2uiActionAction to execute on click (event or function call)
validationResultA2uiValidationResultPre-computed validation result — button is disabled if valid is false
emitinjectedEvent emitter provided by the render engine

Action types:

// Emit a named event with resolved context (sent back to the agent as v0.9 action)
{"action": {"event": {"name": "submit", "context": {"email": {"path": "/email"}, "formId": "contact"}}}}
 
// Execute a local function (e.g., open a URL) — agent never sees this
{"action": {"functionCall": {"call": "openUrl", "args": {"url": "https://example.com"}}}}

Validation checks reference built-in validators by name. If any check fails, the button is automatically disabled:

{"checks": [{"call": "required", "args": {"value": {"path": "/email"}}, "message": "Email is required"}]}

TextField

A single-line text input with optional label and placeholder.

A2UI typeAngular componentSelector
TextFieldA2uiTextFieldComponenta2ui-text-field
PropTypeDescription
labelstringInput label
valuestringCurrent value (resolved from path reference)
placeholderstringPlaceholder text
validationResultA2uiValidationResultValidation state — shows errors below input when invalid
_bindingsRecord<string, string>Auto-populated by surfaceToSpec() from path references
emitinjectedEvent emitter provided by the render engine
{
  "id": "name-field",
  "component": "TextField",
  "label": "Your name",
  "value": {"path": "/name"}
}

The path reference {"path": "/name"} is resolved by surfaceToSpec(), which also populates _bindings automatically.

CheckBox

A labeled checkbox with two-way binding for its checked state.

A2UI typeAngular componentSelector
CheckBoxA2uiCheckBoxComponenta2ui-check-box
PropTypeDescription
labelstringCheckbox label
checkedbooleanCurrent checked state (resolved from path reference)
validationResultA2uiValidationResultValidation state — shows errors below checkbox when invalid
_bindingsRecord<string, string>Auto-populated by surfaceToSpec() from path references
emitinjectedEvent emitter provided by the render engine

ChoicePicker

A dropdown select control with a list of string options.

A2UI typeAngular componentSelector
ChoicePickerA2uiChoicePickerComponenta2ui-choice-picker
PropTypeDescription
labelstringSelect label
optionsstring[]List of available options
selectedstringCurrently selected value (resolved from path reference)
validationResultA2uiValidationResultValidation state — shows errors below dropdown when invalid
_bindingsRecord<string, string>Auto-populated by surfaceToSpec() from path references
emitinjectedEvent emitter provided by the render engine

DateTimeInput

A date, time, or datetime input with two-way binding.

A2UI typeAngular componentSelector
DateTimeInputA2uiDateTimeInputComponenta2ui-date-time-input
PropTypeDescription
labelstringInput label
valuestringCurrent value (resolved from path reference)
inputType'date' | 'time' | 'datetime-local'HTML input type. Defaults to 'date'
minstringMinimum allowed value
maxstringMaximum allowed value
validationResultA2uiValidationResultValidation state — shows errors below input when invalid
_bindingsRecord<string, string>Auto-populated by surfaceToSpec() from path references
emitinjectedEvent emitter provided by the render engine
{
  "id": "date-field",
  "component": "DateTimeInput",
  "label": "Appointment date",
  "value": {"path": "/appointmentDate"},
  "inputType": "date"
}

Slider

A range slider input with two-way binding.

A2UI typeAngular componentSelector
SliderA2uiSliderComponenta2ui-slider
PropTypeDescription
labelstringSlider label
valuenumberCurrent value (bind via _bindings)
minnumberMinimum value
maxnumberMaximum value
stepnumberStep increment
validationResultA2uiValidationResultValidation state — shows errors below slider when invalid
_bindingsRecord<string, string>Auto-populated by surfaceToSpec() from path references
emitinjectedEvent emitter provided by the render engine
{
  "id": "volume",
  "component": "Slider",
  "label": "Volume",
  "value": {"path": "/volume"},
  "min": 0,
  "max": 100,
  "step": 1
}

Layout Components (continued)

Tabs

A tabbed container that shows one child panel at a time based on the selected tab index.

A2UI typeAngular componentSelector
TabsA2uiTabsComponenta2ui-tabs
PropTypeDescription
tabs{label: string, childKeys: string[]}[]Tab definitions with labels and child component IDs
selectednumberCurrently selected tab index. Defaults to 0
_bindingsRecord<string, string>Auto-populated by surfaceToSpec() from path references
specSpecInjected automatically by the render engine
emitinjectedEvent emitter provided by the render engine
{
  "id": "info-tabs",
  "component": "Tabs",
  "tabs": [
    {"label": "Overview", "childKeys": ["overview-content"]},
    {"label": "Details", "childKeys": ["detail-list"]}
  ],
  "selected": {"path": "/activeTab"}
}

A dialog overlay that renders child content when open. Supports an optional title and dismissible close button.

A2UI typeAngular componentSelector
ModalA2uiModalComponenta2ui-modal
PropTypeDescription
titlestringOptional modal heading
openbooleanWhether the modal is visible
childKeysstring[]Child component IDs rendered inside the modal body
dismissiblebooleanShows a close button when true. Defaults to true
_bindingsRecord<string, string>Bind open to a data model path
specSpecInjected automatically by the render engine
emitinjectedEvent emitter provided by the render engine
{
  "id": "confirm-dialog",
  "component": "Modal",
  "title": "Confirm Action",
  "open": {"path": "/showConfirm"},
  "childKeys": ["confirm-message", "confirm-buttons"],
  "dismissible": true
}

Media Components

Video

Renders an HTML5 <video> element.

A2UI typeAngular componentSelector
VideoA2uiVideoComponenta2ui-video
PropTypeDescription
urlstringRequired. Video source URL
posterstringPoster image URL shown before playback
autoplaybooleanStart playback automatically. Defaults to false
controlsbooleanShow native playback controls. Defaults to true
{
  "id": "intro-video",
  "component": "Video",
  "url": "https://example.com/intro.mp4",
  "poster": "https://example.com/poster.jpg",
  "controls": true
}

AudioPlayer

Renders an HTML5 <audio> element.

A2UI typeAngular componentSelector
AudioPlayerA2uiAudioPlayerComponenta2ui-audio-player
PropTypeDescription
urlstringRequired. Audio source URL
autoplaybooleanStart playback automatically. Defaults to false
controlsbooleanShow native playback controls. Defaults to true
{
  "id": "podcast",
  "component": "AudioPlayer",
  "url": "https://example.com/episode.mp3",
  "controls": true
}

Built-in Functions

Props that use A2uiFunctionCall can reference these built-in functions:

FunctionArgsDescription
formatNumbervalue, precision, groupingFormats a number with optional decimal places and thousands grouping
formatCurrencyvalue, locale, currencyFormats a number as a currency string (default: en-US / USD)
formatDatevalue, localeFormats an ISO date string using toLocaleDateString
pluralizecount, singular, pluralReturns singular or plural form based on count
openUrlurlOpens a URL in a new tab (also usable as a button action)
andany named argsReturns true if all arg values are truthy
orany named argsReturns true if any arg value is truthy
notvalueNegates a boolean value

Component Summary

A2UI TypeAngular ComponentCategory
TextA2uiTextComponentDisplay
ImageA2uiImageComponentDisplay
IconA2uiIconComponentDisplay
DividerA2uiDividerComponentDisplay
RowA2uiRowComponentLayout
ColumnA2uiColumnComponentLayout
CardA2uiCardComponentLayout
ListA2uiListComponentLayout
ButtonA2uiButtonComponentInteractive
TextFieldA2uiTextFieldComponentInteractive
CheckBoxA2uiCheckBoxComponentInteractive
ChoicePickerA2uiChoicePickerComponentInteractive
TabsA2uiTabsComponentLayout
ModalA2uiModalComponentLayout
VideoA2uiVideoComponentMedia
AudioPlayerA2uiAudioPlayerComponentMedia
DateTimeInputA2uiDateTimeInputComponentInteractive
SliderA2uiSliderComponentInteractive

What's Next