Skip to main content

Toggle

The Toggle component is a customizable switch control designed to be used in forms.

Examples

A simple toggle switch with basic configuration

Toggle to enable or disable the feature.

Form Data:
{}

Field Properties

Properties used by this field (inside form field in schema)

NameDescriptionType
nameThe unique identifier for the switch control instance.string
displayNameA string that sets the display name of the switch control.string
descriptionA string providing additional information or instructions about the switch control.string
valueThe initial value of the switch control.boolean
validationAn object for validation rules.object
requiredA boolean indicating if the switch control is required (within validation).boolean
readOnlyA readonly field is not editable and value cannot be changedboolean
disabledA boolean indicating if the switch control is disabled (within validation).boolean

Field Properties - Validation Details

The validation settings within the Textarea component are crucial for ensuring that user input meets specific requirements. Here’s a breakdown of the available validation properties:

PropertyDescription
requiredBoolean value that specifies whether entering data into the field is mandatory.
validateA function for custom validation logic, which can return a boolean or an error message.
requiredDetailContains info msgs about the required validation property