Skip to content
Talk to an engineer

Chat cards

Picker

The user chooses one, or several, of up to 12 options, each with an icon or avatar, a description and a price or badge. Continue unlocks once something is chosen, and the card collapses to one line after.

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

Use it when: The next step depends on a choice between 2–12 concrete options the agent already has: a plan, a time slot, an owner, the channels to notify. Each option needs more than a word to choose well: a description, a price, a badge.

Use something else when: Two or three one-word answers (quick replies or ask_user_question). A yes or no before a change (confirm card). Values the user types in (form with approval). Hundreds of options (ask what they’re looking for, then search).

The template callsThe agent getsWhen
submit({ selected, labels, result })FUNCTION_TOOL_SUBMITTED_BY_USERThe user pressed Continue. selected is always an array of option ids, one item unless multiple is on.
cancel()FUNCTION_TOOL_CANCELLED_BY_USERThe user pressed Cancel. Nothing was chosen.

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

StateWhen it shows
LoadingWhile the options load in place: after Try again, or when they load after the card opens (free time slots, say). While execute runs, the SDK shows its own loader.
Emptyexecute found nothing to choose from: the plan is set by a contract. Cancel reports cancel(), so the agent stops waiting.
Errorexecute couldn’t read the plans and returned the failure as data. Try again loads them in place. Cancel 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
note (optional)stringThe agent’s one line above the options, e.g. why it recommends one.
optionsPickerOption[]2–12 options. A search box shows above more than 6.
multiple (optional)booleanChoose several (checkbox cards). Default: one (radio cards).
max (optional)numberWith multiple: the most the user can choose.
selected (optional)string[]Option ids chosen when the card opens (the agent’s suggestion).
layout (optional)"list" | "grid"”grid”: two columns of compact tiles, for short options like time slots.
submitLabel (optional)string
busyLabel (optional)string
cancelLabel (optional)string
searchPlaceholder (optional)string
receiptLabel (optional)stringReceipt lead-in before the chosen labels. Default “You chose”.
cancelledText (optional)string
FieldTypeNotes
idstring
labelstring
description (optional)string
icon (optional)IconNameIcon in the option’s leading tile. Ignored when avatar is set.
avatar (optional)stringAn image URL, or 1–2 initials, for people, accounts and workspaces.
meta (optional)stringRight-hand detail: a price, a time, a count.
metaSub (optional)stringSmall line under meta, e.g. “per month”.
badge (optional)stringShort badge after the label, e.g. “Recommended”.
disabled (optional)booleanShown but can’t be chosen.
disabledReason (optional)stringWhy it can’t be chosen. Replaces the description.
FieldTypeNotes
choose() (optional)(ids: string[]) => Promise<unknown>Acts on the choice (reserve the slot, switch the plan). Throw to show the error and keep the picker open.

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.