Widgets
Widgets Overview
Build interactive UI that your AI agent shows inline in conversations: forms, cards, tables, charts and more.
What are Widgets?
Widgets are interactive UI components that your AI agent shows inside a conversation. Instead of answering in plain text, the agent displays a card, a form, a table, a chart or a set of buttons right in the chat.
With a Widget, your agent can collect structured details, present data clearly and let visitors act, without leaving the conversation.
You'll find your Widgets under Build › Widgets.
What You Can Do with Widgets
Collect Structured Input
Build forms with text fields, dropdowns, date pickers, checkboxes and radio buttons to gather details from visitors.
Display Rich Content
Show cards, tables, charts, images and Markdown text to present information clearly.
Trigger Actions
Connect buttons and form submissions to API calls, chat messages, links or variable updates.
React to User Input
Show, hide or switch views based on the Widget's current values.
Import and Export
Move Widgets between agents and teams as .widget files.
AI-Assisted Building
Describe a Widget in plain language or start from a template.
Key Concepts
These are the parts every Widget is made of.
| Concept | Description |
|---|---|
| Code | The Widget's layout, written with the built-in components. |
| Schema | The data fields the Widget expects, and their types. |
| Default | The values every field starts with when the Widget first shows. |
| Examples | Saved sets of data for previewing other scenarios in the builder. |
| Functions | What happens when a visitor clicks a button, submits a form or changes a field. |
| States | Named groups of elements that show or hide based on the Widget's current values. |
Connecting Widgets to Actions
A Widget appears in a conversation through an Action. Build the Widget under Build › Widgets, then attach it to a Custom Action. When you create the Custom Action, choose Call API + show widget or Show widget as the action type.
This type has no API URL. The Widget gets its data straight from the details the AI agent collects.
Choose what the agent collects before it shows the Widget:
- All widget variables: the agent collects every field in the Widget's schema.
- Only the variables I choose: the agent collects only the variables you list. Anything else keeps the Widget's default value.
Best suited for:
- Forms that collect details from visitors
- Information cards and menus
- Interactive elements that don't need outside data
This type has an API URL. The Action calls your API first, then shows the Widget with the response.
Best suited for:
- Lookups, such as order status or account details
- Live data, such as stock levels or analytics
- Multi-step tasks that depend on your server's logic
Data Flow for Call API Actions
- The AI agent runs the Action
The agent decides to run the Action and gathers the inputs it needs.
- The Action calls your API
The Action sends a request to your API URL with those inputs.
- Your API responds
Your server handles the request and returns a JSON response.
- The response is merged with the Action's inputs
The API response is combined with the inputs. When both have the same field, the API response wins.
- The Widget shows the combined data
The Widget receives the merged data and renders it in the chat.
Where Widget Data Comes From
A Widget's data can come from several places. Higher-priority sources override lower ones.
| Priority | Source | Description |
|---|---|---|
| 1 (lowest) | Default | The Widget's default values from the builder. |
| 2 | Action input | The details the AI agent collected for the Action. |
| 3 (highest) | API response | The data your API returned (Call API actions only). |
File Uploads
Widgets can take files from the visitor and send them straight to an endpoint you control, then show or reuse the uploaded file's URL. Add an Upload file function to a button. See File Uploads.
Import and Export
Share Widgets between agents, teams or projects as .widget files.
Exporting a Widget
- Open the Widget in the builder.
- Click the ⋯ menu in the top-right corner.
- Select Download to save the Widget as a
.widgetfile.
The file holds the Widget's code, schema, default values, examples, functions and states.
Importing a Widget
- Go to Build › Widgets and open the Create Widgets tab.
- Click Upload Widget.
- Choose a
.widgetfile of up to 1 MB.
The Widget opens in the builder. Click Create to save it, then attach it to any Action.