Skip to content
Design System
GitHub

Questionnaire

v0.23.1Beta

A short set of questions, one per page or all on one form: single and multiple choice, scales and text, required checks and a review page.

API reference

Generated from the types. Every part also takes className.

Questionnaire

questionsrequired
Question[]
mode
"list" | "paged" = "paged"
defaultAnswers
Record<string, string | string[] | number | undefined> = {}
onSubmitrequired
(answers: Answers) => void
submitLabel
stringSame as labels.submit, and wins over it.
requiredMessage
stringSame as labels.required, and wins over it.
labels
Partial<QuestionnaireLabels>The words it says, to translate them.
review
booleanPaged only: a last page that lists the answers, each with Edit, before Submit.
defaultStep
number = 0Paged only: the page to open on, from 0. The review page is questions.length.

QuestionField

questionrequired
Question
valuerequired
string | number | string[]
onChangerequired
(v: Answers[string]) => void
error
ReactNode
labels
Partial<QuestionnaireLabels>The words it says (requiredMark, upTo), to translate them.