Fill Blank
Open in playgroundA mad-libs style template with inline editable slots. The constraint of filling slots produces tighter answers than a freeform textarea.
Preview
Usage
import { FillBlank } from "@/components/socratic-ui/fill-blank";
<FillBlank
question="Describe it in one sentence"
template="I want to build a {what} for {who} that helps them {outcome}."
slots={[
{ id: "what", placeholder: "product type" },
{ id: "who", placeholder: "audience" },
{ id: "outcome", placeholder: "outcome" },
]}
value={pitch}
onChange={setPitch}
/>
API Reference
| Prop | Type | Default |
|---|---|---|
questionrequiredThe headline shown above the template. | string | — |
subtitleOptional supporting copy beneath the question. | string | — |
templaterequiredSentence template with {slot-id} markers for each blank. | string | — |
slotsrequiredSlot definitions. Each id must match a {slot-id} in the template. | { id: string; placeholder: string }[] | — |
valuerequiredSlot id → filled text map. | Record<string, string> | — |
onChangerequiredCalled whenever a slot is edited. | (value: Record<string, string>) => void | — |
completeMessageSuccess summary shown when every slot is filled. | string | "Clear and scoped — that's a strong starting point." |
numberOptional leading question number. | string | — |