UI widgets
Interactive cards the agent renders inline in chat: what they are for, how a widget reaches the conversation, core concepts and data priority.
π§© UI widgets
UI widgets are interactive cards your agent renders inline in a conversation instead of plain text: forms, order lists, pricing tables, charts, booking cards. The visitor clicks buttons and submits forms without leaving the chat.
Widgets are built under Builder β Widgets in a project and attached to the agent under Builder β Functions.
π― What they are for
- Collect structured data β lead forms, requests, booking details.
- Display information β order status, product list, a small report chart.
- Run actions β call an API, send a message, open a link from a button.
- Conditional content β one widget holding both an βofferβ and a βconfirmedβ state.
- Share β export a widget as a
.widgetfile and import it into another project.
π How a widget reaches the chat
A widget never renders on its own β an agent function always renders it:
- 1. Build and save the widget on the Widgets page.
- 2. On the Functions page create a function and set Action to
Show widgetorCall API + show widget, then pick the widget. - 3. The visitor asks something and the agent calls that function.
- 4. The agent fills the widget data according to its schema (or the API response is used).
- 5. The widget renders inside the conversation β both in the playground and in the site chat widget.
- 6. When the visitor clicks a button, the widget's own functions run.
π§± Core concepts
- Code β the layout. Written as JSX, stored as a JSON tree.
- Schema β the data contract. The agent fills exactly these fields.
- Default β sample data used only for the editor preview.
- Examples β extra named payloads for testing different states.
- Functions β what happens on interaction: call API, set variables, send message, open link, dismiss.
- States β show or hide a part of the tree based on conditions.
π Data priority
At render time data is resolved in this order:
API response > function (action) data > Default example > empty values from the schemaSo Default never overrides live data β it only exists for the editor.
π Import and export
Export in the editor downloads a .widget file containing the tree, schema, examples, functions and states. Import on the Widgets page loads it back. An imported widget must be re-attached to a function in the new project.
π§ Not available yet
- The
Mapcomponent. - The iframe-based client function.
- An AI builder that generates a widget from a prompt.