Configure how A2UI surfaces appear, style them to match your brand, and decide whether to show everything on one page or across multiple pages.
| Setting | Where | Purpose |
|---|---|---|
| aiui.set_chat_preview(enabled=True, surface_id="main", width="40%") | Python startup | Enables the split Chat + Canvas right-hand preview panel |
aiui.set_chat_preview(enabled=True, surface_id="main", width="40%")
| theme={"primaryColor": "#2563eb", "font": "Inter"} | createSurface | Surface-level theme configuration |
theme={"primaryColor": "#2563eb", "font": "Inter"}
createSurface
| catalog_id | createSurface | Catalog URI ("basic", v0.9 catalogs/basic/catalog.json, v0.10, or custom) |
catalog_id
"basic"
catalogs/basic/catalog.json
| send_data_model=True | createSurface | Include client data-model state on user actions |
send_data_model=True
| window.aiui.registerSurfaceRenderer(id, fn) | Browser JS | Override rendering for a specific surface or custom catalog |
window.aiui.registerSurfaceRenderer(id, fn)
The built-in Canvas page (/canvas) includes a live Surface selector populated from GET /api/surfaces, so you can push several independent surfaces ("main", "form", "metrics") and switch between them on the same page without reloading.
/canvas
GET /api/surfaces
"main"
"form"
"metrics"
You can also embed a surface directly inside any custom @aiui.page:
@aiui.page
Combine dedicated pages in one app so users can chat alongside a live preview, open a full-screen workspace, and inspect settings separately:
Open any specific surface directly via query string: /canvas?surface=checkout.
/canvas?surface=checkout
PraisonAIUI accepts v0.8, v0.9, and v0.10 messages seamlessly:
| v0.8 (Upgraded automatically) | v0.9 / v0.10 (Native) |
|---|---|
| beginRendering (styles, root) | createSurface (theme, catalogId, sendDataModel) |
beginRendering
styles
root
theme
catalogId
sendDataModel
| surfaceUpdate ({component: {Text: {...}}}) | updateComponents ({component: "Text", ...}) |
surfaceUpdate
{component: {Text: {...}}}
updateComponents
{component: "Text", ...}
| dataModelUpdate (contents: [{key, valueString}]) | updateDataModel (path, value) |
dataModelUpdate
contents: [{key, valueString}]
updateDataModel
path
value
| deleteSurface | deleteSurface |
deleteSurface
| userAction | action |
userAction
action
Use aiui.v08_to_v09(messages) in Python anytime you want to inspect or persist the upgraded v0.9 payload.
aiui.v08_to_v09(messages)
If an agent uses a custom catalog URI (for example https://acme.example/a2ui/shop.json), register a custom renderer in custom JS (aiui.set_custom_js(...)):
https://acme.example/a2ui/shop.json
aiui.set_custom_js(...)
| Method | Endpoint | Description |
| GET | /api/surfaces | List all active surfaces and message counts |
GET
/api/surfaces
| GET | /api/surfaces/capabilities | Return A2UI supported versions, catalog IDs, 18 components, and 14 functions |
/api/surfaces/capabilities
| GET | /api/surfaces/{id} | Fetch surface messages and metadata (returns empty list if not yet created) |
/api/surfaces/{id}
| POST | /api/surfaces/{id}/messages | Append or replace ("replace": true) messages (v0.8 / v0.9 / v0.10) |
POST
/api/surfaces/{id}/messages
"replace": true
| POST | /api/surfaces/{id}/action | Submit user action (/actions alias also supported) |
/api/surfaces/{id}/action
/actions
| DELETE | /api/surfaces/{id} | Delete surface |
DELETE