Bote A2UI

July 21, 2026 · View on GitHub

A React rendering SDK for the A2UI protocol — turn LLM-generated UI messages into interactive web interfaces, with theming, custom components, and a live Playground.

English | 中文 · Repository: github.com/BoteAI/a2ui

This project is under active development. @boteai/a2ui-render, @boteai/a2ui-custom-kit, and @boteai/a2ui-comp-preset are being prepared for open source. Feedback and contributions are welcome.


Try the Playground

Browse 30+ component demos, switch themes, and edit JSON — no Agent setup required.

Requirements: Node.js 16+ and Yarn 1.x

git clone https://github.com/BoteAI/a2ui.git
cd a2ui

yarn bs          # install workspace dependencies
yarn build       # build packages (first run or after package changes)
yarn start       # start Playground dev server

Open in your browser:

PageURL
Playground v0.9 (default)http://localhost:8000/#/a2ui-playgroup/v9
Playground v0.8http://localhost:8000/#/a2ui-playgroup/v8
Preset component cataloghttp://localhost:8000/#/a2ui-preset-catalog?component=PresetSelect
Custom component guidehttp://localhost:8000/#/a2ui-playgroup/v9/custom-components-guide

Alternatively: cd app && yarn dev — same as yarn start from the repo root.

While developing packages, run yarn watch in another terminal to rebuild @boteai/a2ui-render, @boteai/a2ui-custom-kit, and @boteai/a2ui-comp-preset on change.


What Problem Does It Solve?

When an AI Agent or backend sends A2UI protocol messages (structured JSON describing UI layout, data bindings, and actions), you need a client-side renderer that can:

  1. Parse streaming or batch protocol messages
  2. Draw standard A2UI components (Text, Button, Card, List, …)
  3. Apply consistent theming across surfaces
  4. Wire user interactions back to your business layer via onAction
  5. Extend the component catalog when the protocol references your own component names

Bote A2UI is a Web / React solution for that pipeline, focused on browser-based Agent UI, chat bubbles, admin consoles, and micro-frontends.

Agent / Backend
      │  A2UI messages JSON

@boteai/a2ui-render          ← protocol renderer (React + Lit surface)
      │  customComponents registry
      ├──────────────────────────────────┐
      ▼                                  ▼
@boteai/a2ui-comp-preset       @boteai/a2ui-custom-kit
(built-in Preset components)   (define, register, bundle custom components)
      │                                  │
      └──────────────┬───────────────────┘

        Your business UI (local bundle or remote .mjs)

Packages

PackagenpmRole
a2ui-render@boteai/a2ui-renderA2UI v0.8 / v0.9 protocol renderer
a2ui-custom-kit@boteai/a2ui-custom-kitCustom component authoring toolkit
a2ui-comp-preset@boteai/a2ui-comp-presetBuilt-in Preset component registry and JSON Schemas

This repo also ships a Playground app under app/ for browsing demos, editing JSON, and validating custom components — not published to npm.


Key Features

1. Protocol Rendering Engine

BaseRenderer accepts an array of A2UI messages and renders a fully interactive surface. Supports protocol v0.8 and v0.9, automatic version inference, responsive helpers, and declarative action callbacks.

import { BaseRenderer, type A2UIMessage } from '@boteai/a2ui-render';

<BaseRenderer
  messages={messages}
  protocolVersion="0.9"
  themePreset="deepBlueWisdom"
  onAction={({ name, context }) => {
    // handle button clicks, form submits, etc.
  }}
/>

2. Built-in Theme Presets — One-Prop Switching

Four curated visual themes ship out of the box (plus a default base), each implemented as CSS variable overrides and optional Shadow DOM stylesheets. Switch themes at runtime with a single themePreset prop — no rebuild required.

PresetDescription
defaultA2UI Lit default tokens
conversationChat-friendly spacing and rounded controls
cyberVibrant tech / neon accent style
platformInterconnectEnterprise platform interconnect look
deepBlueWisdomDeep blue wisdom dashboard style

See packages/a2ui-render/styleVars.md for the full token list.

3. Custom Components — Two Integration Paths

When protocol messages reference your own component names, register implementations via @boteai/a2ui-custom-kit:

PathWhen to useOutput
Local registryComponents live in the same app as the renderercustomComponents object passed to BaseRenderer
Remote ESM bundleIndependent teams, CDN delivery, micro-frontendsesbuild .mjs loaded via loadRemoteA2UICustomRegistry

Both paths share the same registry shape — define API with Zod, implement as native Web Component or React bridge, merge entries, and hand off to the renderer.

Custom component development and runtime rendering pipeline

Typical local flow

import {
  defineComponentApi,
  createReactComponent,
  defineRegistryEntry,
  mergeRegistryEntries,
} from '@boteai/a2ui-custom-kit';

const api = defineComponentApi({ name: 'MyCard', shape: { title: z.string() } });
const element = createReactComponent(({ title }) => <div>{title}</div>);
const registry = mergeRegistryEntries(defineRegistryEntry({ api, element }));

Remote flow

import { loadRemoteA2UICustomRegistry, mergeRegistryEntries } from '@boteai/a2ui-render';

const remote = await loadRemoteA2UICustomRegistry(
  'https://cdn.example.com/custom-components.mjs',
);
const customComponents = mergeRegistryEntries(localRegistry, remote);

Detailed guides: packages/a2ui-custom-kit/README.md · app/public/docs/custom-components-guide.md

4. A2UI Playground

A built-in Playground lets you explore, preview, and iterate without wiring a full Agent first.

A2UI Playground — component gallery with theme switching

CapabilityDetails
Component gallery30+ v0.9 demos across cards, forms, data views, and special scenarios
Protocol toggleSwitch between A2UI v0.8 and v0.9
Live theme switchPreview all built-in presets side by side
JSON editorEdit messages in place and see instant preview
Custom component guideOpen Remote Showcase in the gallery → Development Guide, or read app/public/docs/custom-components-guide.md

See Try the Playground for how to start the app locally.

5. Built-in Preset Components (@boteai/a2ui-comp-preset)

The official A2UI catalog covers core layout and input primitives. @boteai/a2ui-comp-preset ships a curated set of production-ready Preset components — data tables, charts, metrics, dashboard cards, and more — so integrators can use richer UI without building everything from scratch.

A2UI Preset Component Catalog — browse, preview, and edit Messages JSON

The Playground includes a Preset Component Catalog (/a2ui-preset-catalog). Browse all 12 components by category (layout, content, data display, interactive, card), preview live rendering, inspect props, and edit Messages JSON inline.

PageURL
Preset catalog (example: Select)http://localhost:8000/#/a2ui-preset-catalog?component=PresetSelect
Preset catalog (index)http://localhost:8000/#/a2ui-preset-catalog

Full component reference (props, examples, how to add new presets): packages/a2ui-comp-preset/README.md

ComponentDescription
PresetTitleSection / page title
PresetButtonStyled action button
PresetBadgeStatus / label badge
PresetSelectDropdown select (antd)
PresetRow / PresetColumnFlex layout containers
PresetMetricKPI / metric card
PresetDashboardCardDashboard summary card
PresetDataTableData table
PresetBarChart / PresetPieChartCharts (recharts)
PresetFlightCardFlight status card (domain example)

Pass the generated registry to BaseRenderer.customComponents:

import { BaseRenderer } from '@boteai/a2ui-render';
import { a2uiPresetComponentRegistry } from '@boteai/a2ui-comp-preset';

<BaseRenderer
  messages={messages}
  protocolVersion="0.9"
  customComponents={a2uiPresetComponentRegistry}
  onAction={handleAction}
/>

Subpath exports for tree-shaking and tooling:

Import pathExportWhen to use
@boteai/a2ui-comp-presetregistry + schemasFull bundle
@boteai/a2ui-comp-preset/registrya2uiPresetComponentRegistryRuntime rendering only
@boteai/a2ui-comp-preset/schemasa2uiPresetComponentSchemasAgent prompts, configurators, codegen

To add a new Preset component: create a folder under packages/a2ui-comp-preset/src/, register the name in manifest.ts, then run yarn build. The build script auto-generates registry.ts, per-component JSON Schemas, and embedded Less styles. See packages/a2ui-comp-preset/README.md for the full component list and step-by-step guide.

6. Roadmap — More Preset Components

More Preset components — carousels, rich text, and domain widgets — will land in @boteai/a2ui-comp-preset. Contributions and RFCs are welcome via Issues.


Architecture

┌─────────────────────────────────────────────────────────────┐
│  Agent / LLM                                                 │
│  emits updateComponents / updateDataModel messages           │
└──────────────────────────┬──────────────────────────────────┘
                           │ JSON

┌─────────────────────────────────────────────────────────────┐
│  @boteai/a2ui-render                                           │
│  BaseRenderer → LitSurfaceHost → @a2ui/lit Web Components  │
│  · theme presets · onAction · remote registry merge          │
└──────────────────────────┬──────────────────────────────────┘
                           │ component name lookup
              ┌────────────┴────────────┐
              ▼                         ▼
┌──────────────────────────┐  ┌─────────────────────────────┐
│  @boteai/a2ui-comp-preset │  │  @boteai/a2ui-custom-kit       │
│  PresetDataTable · charts │  │  defineComponentApi · React/   │
│  · metrics · layouts      │  │  native adapters · remote ESM │
└──────────────────────────┘  └─────────────────────────────┘

Which package do I need?

  • Standard A2UI components only@boteai/a2ui-render
  • Built-in Preset components (tables, charts, …)@boteai/a2ui-comp-preset (+ render)
  • Custom components in-app@boteai/a2ui-custom-kit + render; kit produces registry, render consumes it
  • Custom components as remote scripts → kit for authoring + render's loadRemoteA2UICustomRegistry at runtime

Quick Start

Install

yarn add @boteai/a2ui-render

# built-in Preset components (tables, charts, metrics, …)
yarn add @boteai/a2ui-comp-preset

# if you need custom components
yarn add @boteai/a2ui-custom-kit

Minimal render

import { BaseRenderer } from '@boteai/a2ui-render';

export function AgentPanel({ messages }) {
  return (
    <BaseRenderer
      messages={messages}
      protocolVersion="0.9"
      themePreset="conversation"
      onAction={(event) => console.log(event.name, event.context)}
    />
  );
}

With built-in Preset components

import { BaseRenderer } from '@boteai/a2ui-render';
import { a2uiPresetComponentRegistry } from '@boteai/a2ui-comp-preset';

<BaseRenderer
  messages={messages}
  protocolVersion="0.9"
  customComponents={a2uiPresetComponentRegistry}
  onAction={handleAction}
/>

With custom components

import { BaseRenderer } from '@boteai/a2ui-render';
import { mergeRegistryEntries } from '@boteai/a2ui-custom-kit';
import { a2uiPresetComponentRegistry } from '@boteai/a2ui-comp-preset';
import { myCustomRegistry } from './my-custom-registry';

<BaseRenderer
  messages={messages}
  protocolVersion="0.9"
  customComponents={mergeRegistryEntries(a2uiPresetComponentRegistry, myCustomRegistry)}
  onAction={handleAction}
/>

API Highlights

@boteai/a2ui-render

ExportDescription
BaseRendererCore renderer — messages + optional registry
BoteRendererBote-specific renderer extension
LitSurfaceHostLow-level Lit surface host (advanced)
A2UI_THEME_PRESETS / A2UI_THEME_PRESET_NAMESBuilt-in theme definitions
loadRemoteA2UICustomRegistryDynamic import a remote .mjs registry
loadRemoteA2UICustomRegistriesBatch-load multiple remote registries
inferProtocolVersionFromMessagesAuto-detect v0.8 vs v0.9
useResponsive / isMobileResponsive utilities

@boteai/a2ui-custom-kit

ExportDescription
defineComponentApiZod-based component API schema
defineRegistryEntry / defineSimpleRegistryEntryBuild registry entries
mergeRegistryEntriesMerge local + remote registries
createReactComponentReact → A2UI custom element adapter
createNativeElementNative Web Component adapter
readComponentProps / dispatchA2UIActionRuntime element helpers
subscribeV09ComponentUpdatesSubscribe to v0.9 property updates

@boteai/a2ui-comp-preset

ExportDescription
a2uiPresetComponentRegistryBuilt-in Preset component registry — pass to BaseRenderer.customComponents
a2uiPresetComponentSchemasPer-component JSON Schemas (agent / codegen format)

Subpath exports: @boteai/a2ui-comp-preset/registry, @boteai/a2ui-comp-preset/schemas.


Development

# install all workspace dependencies
yarn bs

# start Playground (see "Try the Playground" above)
yarn start

# watch all packages
yarn watch

# build all packages
yarn build

# publish (bumps version + gitHead)
yarn pub a2ui-render 0.1.1
yarn pub a2ui-custom-kit 0.1.1
yarn pub a2ui-comp-preset 0.1.0


License

Apache