Main Editor
The main editor is where you write the widget’s visual layout using the built-in component library. It includes:- Autocomplete and type hints for all available components and their properties.
- Syntax highlighting for readable, structured code.
- A Copy button next to the JSON toggle for quick clipboard access.
Code Syntax
The code editor uses a JSX-like syntax. Below are the key patterns for working with data in your widget code.Variables
Reference data fields using curly braces. Each variable maps to a field defined in the schema.Nested Data
Access nested objects using dot notation.Loops
Repeat elements over an array using.map().
String Interpolation
Combine static text with data fields using backticks and${} syntax.
Schema
The Schema editor lives in the footer panel. It defines the data fields the agent needs to provide when rendering the widget. Schemas are written using Zod. The footer panel includes a Zod/JSON toggle:- Zod — the editable schema definition.
- JSON Schema — a read-only, auto-generated view derived from the Zod schema.
The schema is how the agent knows what data to pass into the widget. Each field in the schema maps to a variable you can reference in the code.
Default Example
The Default tab in the footer panel contains the initial values for all schema fields. These values are used when the widget first renders in the preview.Named Examples
Named examples let you visualize different data scenarios without changing the default values. Use them to test how the widget looks with varying data — for example, 1 item vs 5 items, or an empty state vs a post-submission state.Named examples are for previewing in the builder only. At runtime, data comes from the action. See the Overview page for details on data sources.