You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tools/show-widget.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,8 @@ read_when:
15
15
16
16
When the agent calls `show_widget`, OpenClaw core wraps `widget_code` in a minimal HTML document, stores it as a Canvas document, and returns a preview handle. The Control UI renders that handle as a sandboxed iframe directly under the tool call, while native apps use an isolated web view. Both restore the widget after history reload.
17
17
18
+
In Control UI sessions, a Canvas widget can also be pinned to the session dashboard. Set `pin: true` in the tool call, or use **Pin to dashboard** on an existing transcript widget. Pinning reuses the exact hosted document; it does not fetch widget HTML through the browser.
19
+
18
20
For browser embedding, the wrapper document injects four small host bridges around the widget code:
19
21
20
22
- A size reporter posts the rendered content height to the embedding chat, which clamps it and fits the iframe (160 to 1200 pixels).
@@ -87,7 +89,15 @@ Both implementations use the same required fields:
87
89
88
90
Discord also accepts optional `button_label` text for the Activity launch button. The Canvas schema intentionally omits this Discord-only field.
89
91
90
-
The core result includes a Canvas preview handle, so the Control UI and supported native apps render the widget directly from the tool call and restore it after history reload. Discord returns the stored widget and posted-message identifiers.
92
+
The core Canvas tool accepts these optional dashboard placement fields:
93
+
94
+
-`pin`: also place the widget on the session dashboard.
95
+
-`name`: stable widget name; defaults to a slug of `title`.
96
+
-`tab`: destination tab slug.
97
+
-`size`: one of `sm`, `md`, `lg`, `xl`, or `full`.
98
+
-`after`: sibling widget name after which to place the widget.
99
+
100
+
The core result includes a Canvas preview handle, so the Control UI and supported native apps render the widget directly from the tool call and restore it after history reload. Pinned results also retain the board widget name so the Control UI does not offer a duplicate pin after transcript reload. Discord returns the stored widget and posted-message identifiers.
91
101
92
102
`discord_widget` remains registered as a deprecated alias for one release. New agent calls should use `show_widget`.
0 commit comments