Generative UI
Render interactive components like cards, forms, and players instead of plain text responses.
Overview#
Generative UI lets agents render rich interactive components. Instead of plain text, users see charts, email cards, event cards, forms, and more — the kind of interface you'd expect from a native app, not a chatbot.
The goal: users should feel like they're using a native app, not chatting with a bot.
You can browse all available components with live previews and code examples.
Declaring Components#
UI components are declared in agent.yaml as a map (not a list):
ui_components:
email_card: {}
event_card: {}
survey: {}The field MUST be ui_components, not ui. Using ui: is silently ignored. And it must be a map, not a list — using a list causes a YAML parsing error.
Here's the wrong vs right:
# WRONG - silently ignored
ui:
email_card: {}
# WRONG - YAML parse error
ui_components:
- email_card
- event_card
# CORRECT
ui_components:
email_card: {}
event_card: {}Rendering Components#
Use the corresponding render_* tool to display a component:
render_email_card(
from: "[email protected]",
subject: "Meeting tomorrow",
preview: "Let's sync on the project status..."
)
render_event_card(
title: "Team Standup",
date: "2025-03-15",
time: "10:00 AM",
location: "Zoom"
)The agent decides when to render based on context. You don't need to tell it explicitly in the prompt — declaring ui_components is enough.
Component Actions#
Components can have actions (buttons) that users can trigger. When clicked, the framework routes the action back to the agent.
For example, an email card might have “Reply”, “Archive”, and “Forward” actions.
Actions are defined in the component schema (in harness-ui), not in agent.yaml. You can customize action labels in ux.yaml:
ui_components:
email_card:
actions:
archive:
labels:
running: "Archiving email"
finished: "Email archived"Action labels in ux.yaml are a planned feature. Currently, labels are defined in the component source code.
Artifact Actions#
Buttons that appear on agent-generated artifacts (files). These turn generated content into one-click workflows:
artifact_actions:
- tool: twitter_post
label: Post to X
matches:
- "*single*.md"
- twitter
input:
content: "{{artifact.content}}"| Field | Required | Description |
|---|---|---|
tool | Yes | Tool to invoke when clicked |
label | Yes | Button label shown to the user |
matches | Yes | Glob patterns or labels to match artifacts against |
input | No | Template mapping for tool input parameters |
Artifact actions turn generated content into one-click actions. Write a tweet draft, user clicks “Post to X”, and it's posted.
Available Components#
Components span a wide range of categories — from core primitives to domain-specific UI:
| Category | Examples |
|---|---|
| Core | survey, form, chart, table, progress, player |
| email_card, email_composer, inbox_view | |
| Calendar | event_card, calendar_view, schedule |
| Finance | transaction_card, portfolio, invoice |
| Healthcare | vitals_card, appointment, prescription |
| Legal | contract_card, clause_editor, compliance |
| Commerce | product_card, order_status, cart |
Browse All Components
Explore 68 components with live previews, props editors, and code examples.