Overview
render_html lets the agent return rich desktop cards instead of plain Markdown. Use it for charts, tables, diagrams, compact dashboards, approval-like forms, or self-contained interactive views.
Widgets are rendered in sandboxed iframes. They do not have network access, cannot load external scripts/styles/images/fonts, and should use inline CSS/JS only.
Modes
| Mode | Behavior |
|---|---|
display | Render immediately and return to the agent. User interactions stay inside the widget. |
input | Block until the user submits/cancels, then return a flat JSON result to the agent. |
display for dashboards and visualizations. Use input for structured forms where the next agent step depends on user input.
Theming
The desktop app injects design tokens as CSS variables:.field, .grid-2, .chip, .actions, and .muted.
Input widgets
Submit exactly once withntrp.submit({...}), or use ntrp.submitForm(form) for normal form collection.
accept, decline, or cancel plus submitted values.
Constraints
- Keep HTML fully self-contained.
- Do not use external links, scripts, stylesheets, images, fonts, fetch/XHR, or form actions.
- Use
data:URIs for images if needed. - Do not draw your own outer card; the desktop app already supplies the card shell and title.