AskUserQuestions
Stepped question flow with 2–5 options, single or multi-select, inline 'other' input, optional skip, and multi-question navigation.
Installation
Install AskUserQuestions from the Fluid Effect UI registry.
Multiple questions
Question 1 of 4
What's your role?
Multi-select
Question 1 of 3
Which features should we prioritize?
With other
Question 1 of 3
What's blocking you most right now?
Free text
Question 1 of 3
What should we call your workspace?
Free text validation
Question 1 of 1
Your work email?
Skippable
Question 1 of 3
How long have you been using the product?
Chip on left
Question 1 of 5
Pick your role
Stacked layout
Question 1 of 8
Which starting template fits your project?
Controlled
Question 1 of 4
What's your role?
API Reference
Types come from the public API. A dash indicates no default is documented here.
AskUserQuestions props
Public source| Prop | Type | Default | Description |
|---|---|---|---|
key | KeepAliveKey<K, Ends> | undefined | '' | The child's identity among its parent's children of one component, or a kept child's among its author's. The empty string by default. |
onEmit | Show type((events: { readonly _tag: "AnswersChanged"; readonly answers: { readonly [x: string]: { readonly selectedIds: readonly string[]; readonly questionId: string; readonly otherText?: string; readonly skipped?: boolean; }; }; } | { readonly _tag: "CurrentIndexChanged"; readonly index: number; } | { readonly _tag: "Completed"; readonly answers: { readonly [x: string]: { readonly selectedIds: readonly string[]; readonly questionId: string; readonly otherText?: string; readonly skipped?: boolean; }; }; } | { readonly _tag: "Skipped"; readonly questionId: string; readonly index: number; }) => NoInfer<Msg> | undefined) | { readonly AnswersChanged: (event: { readonly _tag: "AnswersChanged"; readonly answers: { readonly [x: string]: { readonly selectedIds: readonly string[]; readonly questionId: string; readonly otherText?: string; readonly skipped?: boolean; }; }; }) => NoInfer<Msg> | undefined; readonly CurrentIndexChanged: (event: { readonly _tag: "CurrentIndexChanged"; readonly index: number; }) => NoInfer<Msg> | undefined; readonly Completed: (event: { readonly _tag: "Completed"; readonly answers: { readonly [x: string]: { readonly selectedIds: readonly string[]; readonly questionId: string; readonly otherText?: string; readonly skipped?: boolean; }; }; }) => NoInfer<Msg> | undefined; readonly Skipped: (event: { readonly _tag: "Skipped"; readonly questionId: string; readonly index: number; }) => NoInfer<Msg> | undefined; } | undefined | — | Handle the child's events with a callback, or supply one handler per tag for tagged events. Return a parent message to dispatch it, or `undefined` to ignore the event. |
props.id | string | Required | |
props.questions | Show typereadonly { readonly title: string; readonly id?: string; readonly options?: readonly { readonly title: string; readonly id?: string; readonly description?: string; }[]; readonly multiSelect?: boolean; readonly allowOther?: boolean; readonly otherPlaceholder?: string; readonly skippable?: boolean; readonly nextLabel?: string; readonly chipPosition?: "left" | "right"; readonly layout?: "inline" | "stacked"; readonly freeText?: boolean; readonly freeTextPlaceholder?: string; readonly freeTextMultiline?: boolean; }[] | Required | |
props.size | "default" | "compact" | 'default' | |
props.currentIndex | number | model.index | |
props.defaultCurrentIndex | number | 0 | |
props.answers | Show type{ readonly [x: string]: { readonly selectedIds: readonly string[]; readonly questionId: string; readonly otherText?: string; readonly skipped?: boolean; }; } | model.answers | |
props.defaultAnswers | Show type{ readonly [x: string]: { readonly selectedIds: readonly string[]; readonly questionId: string; readonly otherText?: string; readonly skipped?: boolean; }; } | {} | |
props.advanceOnSelect | boolean | — | |
props.validationError | string | — | |
props.className | string | — | |
props.shape | "rounded" | "pill" | "sharp" | 'sharp' |