Basic Example (Fields Array)
Thefields array is the primary format produced by the WYSIWYG Builder’s visual form designer.
Complete Example (Fields Array)
Example Code
JSON Schema Format (Advanced)
For advanced use cases, you can provide a standard JSON Schema instead of a fields array. The form renderer will use SchemaAutoForm to auto-generate the UI.Properties
Identifies this as a form blockMust be
formThe endpoint URL to POST form data to when submitted
The HTTP method for the form submissionAllowed values:
POST, PUT, PATCHThe label text for the submit button
The label text for an optional cancel button. Leave empty to hide the cancel button.
A unique identifier for this form block. Included in the submission payload.
Controls how form fields are arrangedAllowed values:
stacked (vertical), columns (side-by-side), inline (horizontal)An array of field objects that define the form fields. This is the format produced by the visual builder. Each field has properties like
id, field_type, label, placeholder, required, options, etc. See Field Types below.A JSON Schema object that defines the form fields. Alternative to
fields for advanced use cases. See JSON Schema Field Types below.Default values for the form fields. Keys should match field IDs (for
fields array) or property names (for schema).Field Types (Fields Array)
When using thefields array format, each field object supports the following field_type values:
| Field Type | Rendered As | Notes |
|---|---|---|
text | Text input | Single-line text, supports min_length, max_length, pattern |
textarea | Textarea | Multi-line text input |
number | Number input | Numeric input, supports min, max |
email | Email input | Validates email format |
url | URL input | Validates URL format |
password | Password input | Masked text input |
date | Date picker | Calendar selector |
select | Select dropdown | Requires options array with { label, value } pairs |
radio | Radio buttons | Requires options array with { label, value } pairs |
checkbox | Checkbox | Boolean toggle |
Field Properties
| Property | Type | Description |
|---|---|---|
id | string | Unique field identifier (used as key in submission payload) |
field_type | string | One of the field types above |
label | string | Display label for the field |
placeholder | string | Placeholder text |
required | boolean | Whether the field is required |
default_value | any | Default value |
help_text | string | Helper text shown below the field |
min_length | number | Minimum string length (text/textarea/password) |
max_length | number | Maximum string length (text/textarea/password) |
min | number | Minimum value (number) |
max | number | Maximum value (number) |
pattern | string | Regex pattern for validation (text) |
options | array | Options for select/radio: [{ "label": "...", "value": "..." }] |
Field Types (JSON Schema)
When using theschema format, field types are determined by the JSON Schema type and format:
| JSON Schema Type | Rendered As | Notes |
|---|---|---|
string | Text input | Default for string types |
string + format: "email" | Email input | Validates email format |
string + format: "uri" | URL input | Validates URL format |
string + format: "date" | Date picker | Calendar selector |
string + uniforms.multiline: true | Textarea | Multi-line text input |
string + enum: [...] | Select dropdown | Options from enum values |
number / integer | Number input | Numeric input with validation |
boolean | Checkbox | Toggle on/off |
Submission Payload
When the form is submitted, the following payload is POSTed to theaction_url:
Server Response
The server can respond with the same action types as Button responses:Nesting Rules
Theform block can be placed inside:
- Root level
- Section
- Wizard Step
- Column Layout columns
Usage Notes
- The WYSIWYG Builder uses the
fieldsarray format with its visual form designer — no JSON editing required - When using
fields, a JSON Schema is generated internally for rendering via SchemaAutoForm - Both
fieldsandschemaformats produce identical rendered forms - Forms support client-side validation before submission
- Server-side validation errors can be returned and displayed inline
