AskUserQuestions

Stepped question flow with 2–5 options, single or multi-select, inline 'other' input, optional skip, and multi-question navigation.

Installation

Example

Question 1 of 8

How do you plan to use BoringUI?

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?

Skippable

Question 1 of 3

How long have you been using the product?

Stacked layout

Question 1 of 8

Which starting template fits your project?

Controlled

Question 1 of 4

What's your role?

API Reference — AskUserQuestions

PropTypeDefaultDescription
questionsAskUserQuestion[]Ordered list of questions to ask. 2–5 options per question is recommended.
currentIndexnumberControlled index of the active question.
defaultCurrentIndexnumber0Initial question index (uncontrolled mode).
onCurrentIndexChange(index: number) => voidCalled when the active question changes.
answersRecord<string, AskUserAnswer>Controlled answers map keyed by question id.
defaultAnswersRecord<string, AskUserAnswer>Initial answers (uncontrolled mode).
onAnswersChange(answers: Record<string, AskUserAnswer>) => voidCalled whenever any answer changes.
onComplete(answers: Record<string, AskUserAnswer>) => voidCalled after the last question is answered or submitted.
onSkip(questionId: string, index: number) => voidCalled when the user clicks Skip on a question.
skipLabelstring"Skip"Label for the skip control in the header.

API Reference — AskUserQuestion

PropTypeDefaultDescription
idstringStable identifier used to key the answer. Falls back to position.
titlestringQuestion text shown above the options.
optionsAskUserOption[]2–5 options to choose from.
multiSelectbooleanfalseAllow multiple options to be selected. Adds a Next button at the bottom.
allowOtherbooleanfalseRender an always-visible inline text input for free-form answers.
otherPlaceholderstring"Describe in your own words…"Placeholder for the Other input.
skippablebooleantrueShow the Skip control in the header.
nextLabelstringLabel for the Next button in multi-select mode. Defaults to 'Next' or 'Finish'.
layout"inline" | "stacked""inline"Row layout. 'stacked' places the description on its own line under the title — use when descriptions are long enough to wrap.

API Reference — AskUserOption

PropTypeDefaultDescription
idstringStable identifier returned in the answer. Falls back to position.
titlestringBold leading label for the option.
descriptionstringSecondary muted text shown after the title.

API Reference — AskUserAnswer

PropTypeDefaultDescription
questionIdstringId of the question this answer belongs to.
selectedIdsstring[]Selected option ids. Length 0–1 in single-select, 0–N in multi-select.
otherTextstringFree-form text from the Other input, if any.
skippedbooleanTrue when the user skipped the question.