Basic Usage
Parameters
Unique identifier for the question.
The main question text.
Additional text to provide context or instructions.
Minimum required length of the response.
Maximum allowed length of the response.
Placeholder text for the input field.
Whether the question is required.
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:
rootinnerContainertextContainertextsubTextinputerrorMessage
Data
Response Format The TextInput question type returns a string containing the user’s text input:responseLength: The length of the response.
- The response is not empty when required is true.
- The response length is at least minLength (if specified).
- The response length does not exceed maxLength (if specified).
- Any custom validation provided in the
customValidationfunction passes.
Methods
The TextInput question type inherits methods from the base Element class and includes some specific methods:Set the response for the question.Parameters:
value(string): The text response
Validate the current response against the question’s rules.Returns:
- An object with
isValid(boolean) anderrorMessage(string) properties.

