Open Questions
Open in playgroundA stack of open-ended prompts, each with its own auto-growing textarea. Use when the AI needs every blank filled in one shot — not a sequence and not a single freeform field.
Preview
Usage
import { OpenQuestions } from "@/components/socratic-ui/open-questions";
<OpenQuestions
question="Help me understand what you're hitting"
prompts={[
{ id: "goal", text: "What are you trying to make happen?" },
{ id: "tried", text: "What have you tried so far?" },
{ id: "stuck", text: "Where exactly does it break?" },
]}
value={answers}
onChange={setAnswers}
/>
API Reference
| Prop | Type | Default |
|---|---|---|
questionrequiredOverall heading for the set of prompts, shown above the stack. | string | — |
subtitleOptional supporting copy beneath the heading. | string | — |
promptsrequiredPrompts to ask. Each id becomes a key in the value/onChange map. | { id: string; text: string; placeholder?: string }[] | — |
valuerequiredPrompt id → user-entered text. | Record<string, string> | — |
onChangerequiredCalled whenever any prompt's textarea is edited. | (value: Record<string, string>) => void | — |
completeMessageSuccess summary shown when every prompt is answered. | string | "Thanks — that gives me what I need to dig in." |
numberOptional leading question number (e.g. "05"). | string | — |
motionShared motion config threaded through entrance animations. | SocraticMotion | — |