QuestionEditor

Typed questions for a decision model: yes/no, a choice of options, a score on levels, and a box for models that draw one, each with a name, instructions and what its answers mean.

View source
  1. is_invoice
  2. team
    Options
import { QuestionEditor } from "@logicplanes/kaeso-ui/playground";

Props

  • allowBox
    boolean = false

    Offers the Box type, for a model that answers with a box on an image.

  • aria-label
    string

    The group's accessible name ("Questions" by default).

  • disabled
    boolean = false

    Turns off every field and button.

  • layout
    "compact" | "panel" = panel

    Questions 24px apart in a panel, or 16px in a narrow column.

  • maxLevels
    number = 10

    Levels a score takes at most (10 by default): Add level turns off there and says so.

  • maxOptions
    number = 255

    Options a choice takes at most (255 by default): Add option turns off there and says so.

  • maxQuestions
    number

    Questions at most; none by default.

  • onValueChange
    (next: DecisionQuestion[]) => void

    Called with the changed questions. A question added here has an id; empty optional text is left out.

  • value
    readonly DecisionQuestion[]

    The questions, in order. Give each an id so its fields keep their place when one above it is removed.