Skip to content
TrademarkTrademark
Docs
Modules

Runtime catalog

Updated: December 2, 2026
View on GitHub

An agent that answers with an interface instead of text sends JSON: which components, with which props, bound to which data. The runtime catalog is the list of Once UI components such an agent may use, with a JSON Schema for each one's props, and the renderers that turn that JSON into real Once UI on screen. Two open protocols carry it:

  • A2UI 1.0, through @a2ui/react: the agent streams createSurface, updateComponents and updateDataModel messages.
  • json-render, through @json-render/react: the agent sends one spec, a flat map of elements, with state by path.

The catalog holds 50 components: layout (Column, Row, Grid, Card), type, buttons, status, forms, data (StatTiles, Table, LineChart, BarChart, PieChart), Map, chat messages and a StyleScope that sets the brand from one seed colour. It is generated from the components' own spec, so it stays in step with the library.

Everything an agent sends is checked before it renders. Only data reaches a component: no functions, no style or className, no unknown props, no javascript: links, and enum values only from the spec. An unknown component renders nothing, and each dropped prop is reported to onIssue.

Installation

The protocols are optional peer dependencies of @once-ui-system/core: install the one the app speaks.

Map and MapMarkers need maplibre-gl, so they live in an entry of their own. To let agents place maps, install it and register the map views once, in a client module the surface renders under:

Without it the app builds without maplibre-gl, and a Map an agent sends shows a short notice instead.

@once-ui-system/core/catalog itself needs neither: it holds the schema, the checks and the prompt, and runs on the server.

json-render

onceCatalog.prompt() (or oncePrompt(onceCatalog, { system })) writes the system prompt that teaches a model the catalog. A Button's on.press names an action from handlers; form fields write their value back with { "$bindState": "/path" }. Run validateOnceSpec on what the model returns: json-render's own validate checks the spec's shape, not each element's props.

A2UI

The agent names the catalog with catalogId: ONCE_A2UI_CATALOG_ID in createSurface. onceA2uiCatalogDocument() is the catalog as an A2UI JSON document, to hand to the agent. Props bind to the data model with { "@path": "/kpi/revenue" }; action (press) and changeAction deliver an event with its context. A2UI prop names are identifiers, so aria-label is ariaLabel. onceBasicCatalog draws A2UI's own basic catalog (Text, Card, TextField, ChoicePicker…) with Once UI, for agents that only know that one.

A2uiSurface renders in the browser only: render it after the component has mounted.

Other transports

CatalogRenderer from @once-ui-system/core/catalog/react renders a plain nested tree ({ type, props, children }) with the same checks, and catalogPrompt() and RUNTIME_CATALOG from @once-ui-system/core/catalog give the prompt and the schema to any other protocol.

Edit this page on GitHub