Basic Usage
Parameters
Unique identifier for the question.
The main question text.
Additional text to provide context or instructions.
An array of strings representing the available options.
Whether the question is required.
Whether to randomize the order of options.
Whether to include an “Other” option with a text input.
The label for the “Other” option, if allowed.
A custom validation function that takes the response as input and returns true if valid, or an error message string if invalid.
Custom styles to apply to the question. Available keys are:
rootinnerContainertextContainertextsubTextoptionsContaineroptionradiolabelotherInputerrorMessage
Data
Response Format The SingleSelect question type returns a string representing the selected option:- An option has been selected when required is set to true.
- If “Other” is selected, the other input is not empty when required is true.
- The selected option is valid (exists in the options array or is “other”).
- Any custom validation provided in the
customValidationfunction passes.
Methods
The SingleSelect question type inherits methods from the base Element class and includes some specific methods:Set the response for the question.Parameters:
value(string or object): The selected option or other value
Validate the current response against the question’s rules.Returns:
- An object with
isValid(boolean) anderrorMessage(string) properties.

