Skip to content

Conversation

@mschienbein
Copy link

@mschienbein mschienbein commented Dec 19, 2025

Summary

Complete React implementation of the A2UI specification, providing a production-ready renderer for React applications.

Core Features

  • Full protocol support: beginRendering, surfaceUpdate, dataModelUpdate, deleteSurface
  • SSE transport with JSONL parsing and automatic reconnection
  • JSON Pointer (RFC 6901) data binding resolution
  • Multi-surface rendering with independent state management
  • Message buffering for out-of-order message delivery

Components (Standard Catalog v0.8)

Category Components
Layout Row, Column, Card, Tabs, Modal, Divider
Content Text (markdown), Image, Icon, Video, AudioPlayer
Interactive Button, TextField, CheckBox, ChoicePicker, DateTimeInput, Slider, List

Architecture

  • MessageProcessor: Central state machine for protocol message handling
  • CatalogRegistry: Version-aware component registration (v0.8, v0.9)
  • A2UISurface: Renders adjacency-list format to React component tree
  • A2UIRoot: Simpler spec-based static rendering

Spec Compliance

  • UserAction format matches client_to_server.json schema exactly
  • Flat structure with sourceComponentId and ISO 8601 timestamp
  • ClientToServerMessage wrapper for wire format

Quick Start

# 1. Build the renderer library
cd renderers/react
npm install
npm run build:lib

# 2. Run the demo
cd ../../samples/client/react
npm install
npm run dev

The demo runs at http://localhost:5173/ with two modes:

  • Spec-Based Demo: Static JSON rendering with theme switching
  • Protocol Demo: Simulated streaming messages with 8 interactive scenarios

Test Plan

  • All 100 unit tests pass (npm test in renderers/react)
  • Run quick start steps above
  • Verify components render in both light/dark themes
  • Test action dispatch from buttons (check browser console)
  • Try Protocol Demo scenarios (Flashcard, Dashboard, Quiz, etc.)

Related

Implements React renderer as discussed in A2UI specification roadmap.

Complete React implementation of the A2UI specification with:

## Core Features
- Full A2UI protocol message processing (beginRendering, surfaceUpdate,
  dataModelUpdate, deleteSurface)
- SSE transport with JSONL parsing and automatic reconnection
- JSON Pointer (RFC 6901) data binding resolution
- Multi-surface rendering with independent state management
- Message buffering for out-of-order delivery

## Components (Standard Catalog v0.8)
- Layout: Row, Column, Card, Tabs, Modal, Divider
- Content: Text (with markdown), Image, Icon, Video, AudioPlayer
- Interactive: Button, TextField, CheckBox, ChoicePicker, DateTimeInput, Slider, List

## Architecture
- MessageProcessor: Central state machine for protocol handling
- CatalogRegistry: Version-aware component registration (v0.8, v0.9)
- A2UISurface: Renders adjacency-list format to React tree
- A2UIRoot: Spec-based static rendering for simpler use cases

## Spec Compliance
- UserAction format matches client_to_server.json schema
- Flat structure with sourceComponentId and ISO 8601 timestamp
- ClientToServerMessage wrapper for wire format

## Sample App
- Interactive demo showcasing all components
- Protocol demo with streaming simulation
- Japanese vocabulary flashcard example
- Light/dark theme support
Document setup instructions and demo modes for the React sample application.
The relative path was wrong (../../ instead of ../../../), causing npm to
create a broken symlink that couldn't resolve the @a2ui/react package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant