Skip to content
Talk to an engineer

Chat cards

Wizard

A short guided setup inside one card: two or three small steps, each checked before Next, then a review of every answer with Edit links back. The card keeps one height across steps, so the chat doesn’t jump.

KindInputAgent waitsYes, for create or cancelMobileVariant: one column, 44px targets

Use it when: A setup needs 5–12 answers that fall into 2–3 natural groups, and later answers make more sense once earlier ones are in: connect an integration, create a webhook, invite a team. The user reviews everything before anything is created.

Use something else when: Up to ~8 fields the agent can mostly draft (form with approval). One choice (picker). A long setup with many sections or dependent screens (onboarding or FORM canvas on desktop).

The template callsThe agent getsWhen
submit({ values, result })FUNCTION_TOOL_SUBMITTED_BY_USERAfter actions.save() succeeds on the review step. A save that throws keeps the review open with the error.
cancel()FUNCTION_TOOL_CANCELLED_BY_USERThe user closed the card (the × in its header). Nothing was created.

Besides its data, the template draws these as itself, with mountState(). Pick one on the preview with State.

StateWhen it shows
LoadingWhile the setup loads again in place, after Try again. While execute runs, the SDK shows its own loader.
Errorexecute couldn’t load what the setup needs and returned the failure as data. Try again loads the steps in place. Cancel setup reports cancel(), so the agent stops waiting.
mountState({ root, head, title: "…", state: { kind: "error", text: "…", retry } });

The hosted action and the in-page handler below show each case. The state types are LoadingState, EmptyState and ErrorState in fs-kit.

FieldTypeNotes
titlestring
subtitle (optional)string
icon (optional)IconName
stepsWizardStep[]1–3 input steps. The review step is added after them.
reviewTitle (optional)string
reviewDescription (optional)string
submitLabel (optional)string
busyLabel (optional)string
cancelLabel (optional)stringAccessible name of the close button, which cancels.
cancelledText (optional)string
receipt (optional)WizardReceiptWhat the card shows after a successful save.
FieldTypeNotes
idstring
titlestringShort name: the step heading and its group on the review step.
description (optional)string
fieldsWizardField[]
FieldTypeNotes
idstring
labelstring
type (optional)"text" | "email" | "url" | "number" | "select" | "textarea" | "choice" | "checks" | "toggle"”choice”: one option (segmented, or cards when options have descriptions). “checks”: several. “toggle”: an on/off switch.
value (optional)string | number | boolean | string[]Starting value. An array for “checks”, a boolean for “toggle”.
required (optional)booleanMust be filled in. For “checks”: at least one.
options (optional)WizardOption[]
placeholder (optional)string
hint (optional)string
pattern (optional)stringA regular expression the whole value must match.
patternMessage (optional)stringShown when the value doesn’t match pattern.
rows (optional)number
mono (optional)booleanMonospace text, for ids, URLs and event names.
FieldTypeNotes
valuestring
labelstring
description (optional)stringSecond line on option cards.
FieldTypeNotes
title (optional)string
subtitle (optional)string
fields (optional)string[]Field ids to show. Default: the first three.
link (optional){ label: string; href: string }
FieldTypeNotes
save() (optional)(values: WizardValues) => Promise<{ url?: string } | void>Saves everything. Throw to show the error on the review step. Return { url } to link the receipt.

Copy the template and the shared kit into your code: agent/ui/ in an agent repo, or anywhere in your app. The template imports only ./fs-kit.js. Then wire it up from the hosted action or the in-page handler.

The hosted action needs an agent repo with one folder per action (agent/actions/<action_key>/index.ts). If your repo keeps its actions in agent/actions/index.ts, use the in-page handler: it runs the same template in your app.

All templates in machine-readable form: /ui-catalog/catalog.json.