1interfaceWidget{2type:"ui"|"html";3interactive?:boolean;4title?:string;5html?:string;// For type="html"6json?:string;// Original JSON for reference7children?:WidgetNode[];8actions?:WidgetActionButton[];9}
Properties
Name
Type
Description
Default
type
"ui" | "html"
Widget type - structured UI or raw HTML
required
interactive
boolean
Whether the widget accepts user input
false
title
string
Optional title displayed above the widget
-
html
string
Raw HTML content (for type="html")
-
children
WidgetNode[]
Child nodes to render (for type="ui")
-
actions
WidgetActionButton[]
Action buttons in the footer
-
WidgetNode
A single UI component within a widget.
typescriptcopy
1interfaceWidgetNode{2type:WidgetNodeType;34// Content5value?:string;6label?:string;78// Image9src?:string;10alt?:string;1112// Form fields13name?:string;14placeholder?:string;15defaultValue?:string;16defaultChecked?:boolean;17options?:WidgetSelectOption[];1819// Styling20variant?:string;21gap?:number;2223// Layout24children?:WidgetNode[];2526// Actions27action?:WidgetAction;2829// Data binding (advanced)30dataKey?:string;31}
Node Types
Primitive Types (render literal values)
Type
Description
text
Plain text display
markdown
Markdown-formatted text
image
Image display
badge
Small label for status/metadata
button
Action button
input
Text input field
select
Dropdown select
checkbox
Binary checkbox
row
Horizontal layout container
col
Vertical layout container
Data-Bound Types (read from ToolInvocation.Data)
Type
Description
plan-list
Renders plan steps from Data
key-value
Renders key-value pairs from Data
status-badge
Renders status badge from Data
WidgetAction
Represents an action triggered by user interaction.