Validation & Config
Validation rules and visual config options for each field type.
Data Object Structure
The data parameter on add_field and update_field is a JSON object:
| Key | Type | Description |
|---|---|---|
| required | boolean | Whether the field is required |
| options | array | Required for select, radio, checkbox. Array of {label, value} |
| validation | object | Validation rules specific to the field type |
| config | object | Visual and behavioral configuration |
Validation Rules by Type
text| Key | Type | Description |
|---|---|---|
| prefix | string | Must start with |
| suffix | string | Must end with |
| contains | string | Must contain |
| notContains | string | Must not contain |
| min | number | Min length |
| max | number | Max length |
| pattern | regex | Regex pattern |
| customMessage | string | Error message |
textarea| Key | Type | Description |
|---|---|---|
| min | number | Min length |
| max | number | Max length |
| customMessage | string | Error message |
email| Key | Type | Description |
|---|---|---|
| customMessage | string | Error message |
number| Key | Type | Description |
|---|---|---|
| min | number | Min value |
| max | number | Max value |
| customMessage | string | Error message |
phone| Key | Type | Description |
|---|---|---|
| customMessage | string | Error message |
url| Key | Type | Description |
|---|---|---|
| customMessage | string | Error message |
date| Key | Type | Description |
|---|---|---|
| minDate | YYYY-MM-DD | Earliest date |
| maxDate | YYYY-MM-DD | Latest date |
| allowedDates | string[] | Only these dates |
| disabledDates | string[] | Exclude these dates |
| customMessage | string | Error message |
select| Key | Type | Description |
|---|---|---|
| customMessage | string | Error message |
radio| Key | Type | Description |
|---|---|---|
| customMessage | string | Error message |
checkbox| Key | Type | Description |
|---|---|---|
| min | number | Min selections |
| max | number | Max selections |
| customMessage | string | Error message |
slider| Key | Type | Description |
|---|---|---|
| min | number | Min value |
| max | number | Max value |
| customMessage | string | Error message |
file| Key | Type | Description |
|---|---|---|
| allowedMimeTypes | string[] | e.g. ["image/png", "application/pdf"] |
| customMessage | string | Error message |
Config Options by Type
text, textarea, email, number, phone, url, select| Key | Type | Description |
|---|---|---|
| variant | enum | default, boxed, minimal, floating |
| size | enum | sm, md, lg |
| helpText | string | Help text below field |
text, email, number, phone, url| Key | Type | Description |
|---|---|---|
| icon | enum | user, mail, phone, calendar, hash, dollar, star, heart, globe, search, clock |
text| Key | Type | Description |
|---|---|---|
| prefix | string | Prefix inside input |
| suffix | string | Suffix inside input |
radio, checkbox| Key | Type | Description |
|---|---|---|
| displayMode | enum | list, grid, cards, images |
| columns | 1-4 | Columns for grid/cards/images |
| helpText | string | Help text below field |
date| Key | Type | Description |
|---|---|---|
| size | enum | sm, md, lg |
| icon | enum | calendar |
| helpText | string | Help text below field |
file| Key | Type | Description |
|---|---|---|
| maxFileSize | number | Max size in bytes |
| helpText | string | Help text below field |
info| Key | Type | Description |
|---|---|---|
| infoStyle | enum | flat, card, banner, callout, quote |
| calloutType | enum | info, tip, warning, success |
image| Key | Type | Description |
|---|---|---|
| url | string | Image URL |
| alt | string | Alt text |
| rounded | enum | none, md, lg, xl |
video| Key | Type | Description |
|---|---|---|
| url | string | Video URL |
download| Key | Type | Description |
|---|---|---|
| url | string | Download URL |
redirect| Key | Type | Description |
|---|---|---|
| url | string | Redirect URL |
Page Config
Pages support a config object via update_page:
| Key | Type | Description |
|---|---|---|
| showTitle | boolean | Show or hide the page title in the form runner. Default: false. |