Skip to main content
A2UI Demo

JSON-Driven UI Generation

The A2UI protocol lets AI agents generate full user interfaces from structured JSON. No custom code — the renderer handles everything.

User Profile Form

A complete form with text fields, checkbox, and button — all from JSON

Agent Status Dashboard

A live agent monitoring panel rendered entirely from structured data

AI Model Selector

An interactive choice picker with dynamic options — no custom code needed

Rendered Output

A2UI v0.11

Edit Profile

Update your personal information below.


7

Component Tree

Containerdirection="column" gap=16
Headinglevel=2
Textvariant="muted"
Divider
TextFieldlabel="Full Name" placeholder="John Doe"
TextFieldlabel="Email" placeholder="jane@example.com"
Sliderlabel="Experience Level" min=1
CheckBoxlabel="Subscribe to newsletter" checked=true
Buttonvariant="primary" label="Save Changes"

How A2UI Works

  1. AI agent generates JSON following A2UI protocol
  2. JSON is validated against component schemas
  3. Renderer maps each type to a React component
  4. Props are bound via JSON Pointer (RFC 6901)
  5. User interactions flow back to the agent via WebSocket

Supported Components

TextHeadingButtonContainerDividerTextFieldCheckBoxSliderTabsListChoicePickerSelect (planned)Image (planned)Table (planned)Chart (planned)Video (planned)Audio (planned)

A2UIRenderer

Drop-in React component that renders any A2UI JSON into interactive UI.

JSON Pointer Binding

RFC 6901 compliant data binding for reactive state management.

WebSocket Transport

Real-time bidirectional communication between agent and UI.

Component Registry

21 standard components with shadcn/ui styling and full accessibility.

How A2UI Works

A2UI (Agent-to-UI) is a protocol that defines how AI agents describe user interfaces using structured JSON. Instead of generating HTML or framework-specific code, agents output a component tree with types, properties, and children. The A2UIRenderer component takes this JSON and maps each node to a real React component using a pluggable component registry. The default registry uses shadcn/ui components for accessible, styled output out of the box.

Data binding uses JSON Pointer (RFC 6901) for reactive state management. When users interact with rendered components — typing in text fields, toggling checkboxes, moving sliders — the changes are captured and sent back to the agent over WebSocket. This creates a bidirectional loop where agents can update the UI in real time based on user input. The protocol supports 21 standard component types covering layout, text, inputs, data display, and navigation. The core library is framework-agnostic with zero dependencies, while renderer implementations exist for React, Vue, and Flutter.

Use Cases

  • Dynamic agent dashboards where AI agents generate monitoring UIs that adapt based on the data they're processing.
  • Conversational form builders where an agent creates forms on the fly based on user requirements expressed in natural language.
  • Multi-agent workspaces where each agent renders its own control panel and they coordinate through shared state.
  • No-code application builders where non-technical users describe interfaces in plain language and the AI generates A2UI schemas.

Integration Guide

Render agent-generated UI with the A2UI renderer:

import { A2UIRenderer } from '@ainative/ai-kit-a2ui';
import { useCoAgent } from '@ainative/ai-kit-a2ui/react';

function AgentUI() {
  const { schema, sendAction } = useCoAgent({
    url: 'wss://api.ainative.studio/agent/ws',
    agentId: 'my-agent',
  });

  return (
    <A2UIRenderer
      schema={schema}
      onAction={(action) => {
        // User clicked button, changed input, etc.
        sendAction(action);
      }}
      components={{
        // Override or extend default components
        CustomChart: MyChartComponent,
      }}
    />
  );
}