Other Models

Reference for Theme, Validation, Option, and other supporting models.

Theme

The Theme model allows you to customize the appearance of your survey. You can define colors, fonts, and other visual elements to match your brand or create a specific look and feel for your survey.

MethodTypeDefaultDescription
fontFamilystring"sans-serif"The text font family. Accepts CSS font-family values.
fontSizestring'inherit'The font size. Accepts CSS font size values.
primaryColorstring'#0f172a'The primary base color using a hexadecimal code.
backgroundColorstring'#ffffff'The background color of the survey using a hexadecimal code.
baseColorstring'#ffffff'The base color for input containers, e.g. textarea background, checkbox container background color.
textColorstringnullThe text color using a hexadecimal code.
errorColorstring'#dc2626'The error color using a hexadecimal code.
neutralColorstring'#d4d4d8'The color of neutral elements using a hexadecimal code.
warningColorstring'#ea580c'The color for warning messages using a hexadecimal code.
buttonColorstringnullThe color for buttons using a hexadecimal code.
borderColorstringnullThe color for borders using a hexadecimal code.
defaultRadiusstring'0'The default radius for buttons, boxes, and inputs. Accepts CSS radius values (e.g., '0.5em').
buttonRadiusstringnullThe radius for buttons. If set, it overrides the default radius. Accepts CSS radius values.
boxRadiusstringnullThe radius for box containers. If set, it overrides the default radius. Accepts CSS radius values.
inputRadiusstringnullThe radius for input elements. If set, it overrides the default radius. Accepts CSS radius values.
textareaRadiusstringnullThe radius for textareas. If set, it overrides the default radius. Accepts CSS radius values.
defaultBorderWidthstring'1px'The default border width for buttons, boxes, and inputs. Accepts CSS width values (e.g., '1px').
buttonBorderWidthstringnullThe border width for buttons. If set, it overrides the default border width. Accepts CSS width values.
boxBorderWidthstringnullThe border width for boxes. If set, it overrides the default border width. Accepts CSS width values.
inputBorderWidthstringnullThe border width for input elements. If set, it overrides the default border width. Accepts CSS width values.

Validation

The Validation model defines rules to ensure that user input meets specific criteria. You can set requirements for input fields, such as minimum and maximum values, selection limits, and valid formats (e.g., email addresses).

MethodTypeDefaultDescription
typeValidationTypeEnumn/a (Required)Specifies the type of the validation rule. e.g. EMAIL
valuestring, number, booleannullRepresents the value that is relevant to the selected validation rule. For example, for a "MIN_LENGTH" rule, this would be the minimum length required.
messagestring(Default message based on validation type)Defines the message that will be displayed when the validation rule is not met.
applicableIfCondition ExpressionnullSpecifies a condition for the validation rule. If set, the rule will only be applied if the condition is met.

Condition

The Condition model is used to define conditional logic within your survey. Conditions determine when specific survey elements (e.g., screens, pages, blocks, inputs) are displayed based on user responses or external variables.

Condition expression can be a string or an object with the following properties:

MethodTypeDefaultDescription
$andCondition[]n/aLogical AND operator for one or more condition rules.
$orCondition[]n/aLogical OR operator for one or more condition rules.
$notCondition[]n/aLogical NOT operator for one or more condition rules.

Conditional logic is a powerful tool for creating dynamic surveys that adapt to user input and external variables. For an in-depth understanding, kindly consult the 'Conditional Logic' section in our documentation.

Enum Data Types

Enum NameDescriptionValues
InputTypeEnumInput TypesCHECKBOX, CHECKBOXTEXT, RADIO, RADIOTEXT, STARSCALE, NUMBERSCALE, LIKERT_SCALE, TEXT, TEXTAREA, TOGGLE, DROPDOWN, IMAGE
LabelPositionEnumLabel PositionsTOP, BOTTOM, LEFT, RIGHT, NONE
LikertPresetEnumLikert Option PresetsAGREEMENT, FREQUENCY, SATISFACTION, QUALITY, IMPORTANCE, FAMILIARITY, AWARENESS, LIKELIHOOD, CONCERN
DropdownPresetEnumDropdown Option PresetsYEARS, MONTHS, MONTHSSHORT, WEEKDAYS, WEEKDAYSSHORT, MONTH_DAYS, COUNTRIES
TextInputTypeEnumText Input ValueEMAIL, NUMBER, DATE, DATETIME, TIME, TEXT
ValidationTypeEnumTypes of Validation RulesREQUIRED, NUMERIC, INTEGER, MINLENGTH, MAXLENGTH, MINVALUE, MAXVALUE, MINSELECTION, MAXSELECTION, EMAIL, URL, DOMAIN, EQUALS, REGEX.

Tip

As you can see, most of the enum values are in uppercase. Actually these values are case-insensitive in general. However, it is recommended to use them in uppercase for consistency.