User form card

The structured questions the assistant asks mid run, a keyboard-first stepper with a review step and settled read-only states.

Question 1 of 2

What matters most to you right now?

Press 1 to 4, or use the arrows and Enter

<UserFormCardform={form}state={state}onSubmit={(answers) => resume(answers)}/>

Usage

import { UserFormCard, type UserFormData, type UserFormAnswer } from "@reva/ui";

Renders the ask_user_form tool call's input: up to four questions, each with up to four options plus a freetext "other". The pending state walks through one question at a time, keyboard first: press 1 to 4 to pick an option, arrows move the highlight, Enter continues, and single-select picks auto-advance. Submission only happens from the final review step.

The host derives state from the transcript and receives the built answers through onSubmit; omitting onSubmit disables sending, which is what a static preview wants. The demo above wires onSubmit to flip its own state, so send the form to see it settle.

Examples

Answered

The submitted selections, read only.

What matters most to you right now?

Retiring comfortably

Which of these do you hold?

Stocks and shares ISA, SIPP or personal pension. A small crypto holding too

Answers sent

<UserFormCard form={form} state={{ status: "answered", answers }} />

Superseded

The conversation moved on without answers, so the form collapses to a quiet note.

This form is no longer waiting for answers.

<UserFormCard form={form} state={{ status: "superseded" }} />

On this page