Skip to main content

Email

The Email component can be used to collect email addresses from users. It is a text field that validates the input against a regular expression pattern to ensure that the input is a valid email address or not. It can be configured to be readonly, disabled, required, and can have a placeholder, helper text, and default value.

Schema

[
{
"name": "email",
"meta": {
"displayName": "Email",
"displayType": "email",
"placeholder": "Enter your email",
"description": "Email will be used for account purposes",
"validation": {
"required": true
},
"readOnly": false
}
}
]

Example

Email will be used for account purposes

Form Data:
{}

Field properties

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

NameDescriptionType
displayNameThe label shown above the text fieldstring
displayTypeThe type of the field to be displayedstring
placeholderThe hint shown in the text fieldstring
readOnlyA readonly field is not editable and value cannot be changedboolean
isDisabledA disabled field is not editable and value cannot be changedboolean
requiredIndicates whether the field is mandatoryboolean
patternA regex pattern that the field value must matchstring
descriptionHelper text or additional description shown below the text fieldstring
valueThe default value of the fieldstring
overrideDynamicSupportTo override the default behavior of showing static and dynamic optionsboolean

Example JSON

Placeholder

[
{
"name": "name",
"meta": {
"displayName": "Name",
"displayType": "text_field",
"placeholder": "Enter your name"
}
}
]

Readonly

[
{
"name": "name",
"meta": {
"displayName": "Name",
"displayType": "text_field",
"readOnly": true,
"value": "Ahmed"
}
}
]

Disabled

[
{
"name": "email",
"meta": {
"displayName": "Email",
"displayType": "email",
"isDisabled": true,
"value": "[email protected]"
}
}
]

Required

[
{
"name": "email",
"meta": {
"displayName": "Email",
"displayType": "email",
"validation": {
"required": true
}
}
}
]

Pattern

[
{
"name": "email",
"meta": {
"displayName": "Email",
"displayType": "email",
"validation": {
"pattern": "/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/"
}
}
}
]

Helper Text

[
{
"name": "email",
"meta": {
"displayName": "Email",
"displayType": "email",
"description": "Enter your email"
}
}
]

Override dynamic support

[
{
"name": "email",
"meta": {
"displayName": "Age",
"displayType": "email",
"description": "Enter your email",
"htmlProps": {
"overrideDynamicSupport": true
}
}
}
]