Questionnaire

inprogress

    Overview

    When to use

    Use the Questionnaire component to collect user input through multiple choice questions.

    The Questionnaire component provides an onChange callback function that allows you to capture changes in the selected values. This can be useful for tracking user progress or displaying a dynamic score based on their choices.


    Component

    Default

    ReadOnly

    Initial Values

    Pass an object to initialValues and initialNAChecked with the matching names.

    States

    Pass an object with the name, current value and state


    Properties

    Default

    PropertyTypeRequiredDefault
    utilClassNamesStringfalse-
    componentRefShape
    { "current": "Any" }
    false-
    labelStringtrue-
    questionsArrayof
    Array<Element>
    true-
    optionsArrayof
    Array<Any>
    true-
    onChangeFuncfalse-
    selectedValuesObjecttrue-
    setSelectedValuesFunctrue-
    initialValuesObjectfalse-
    initialNACheckedObjectfalse-
    statesObjectfalse-

    Questionnaire.Question

    PropertyTypeRequiredDefault
    utilClassNamesStringfalse-
    componentRefShape
    { "current": "Any" }
    false-
    labelStringfalse-
    nameStringfalse-

    Questionnaire.Option

    PropertyTypeRequiredDefault
    utilClassNamesStringfalse-
    componentRefShape
    { "current": "Any" }
    false-
    labelStringtrue-
    valueAnytrue-
    onChangeFuncfalse-
    checkedBoolfalse-
    stateEnum
    'success' │ 'warning' │ 'error'
    false-