Skip to main content
The Form block supports two configuration formats: a fields array (used by the visual builder) and a JSON Schema (for advanced use cases). Both are fully supported at runtime.

Basic Example (Fields Array)

The fields 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

string
required
Identifies this as a form blockMust be form
string
required
The endpoint URL to POST form data to when submitted
string
default:"POST"
required
The HTTP method for the form submissionAllowed values: POST, PUT, PATCH
string
default:"Submit"
required
The label text for the submit button
string
required
The label text for an optional cancel button. Leave empty to hide the cancel button.
string
required
A unique identifier for this form block. Included in the submission payload.
string
default:"stacked"
required
Controls how form fields are arrangedAllowed values: stacked (vertical), columns (side-by-side), inline (horizontal)
array
required
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.
object
required
A JSON Schema object that defines the form fields. Alternative to fields for advanced use cases. See JSON Schema Field Types below.
object
required
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 the fields array format, each field object supports the following field_type values:

Field Properties

Field Types (JSON Schema)

When using the schema format, field types are determined by the JSON Schema type and format:

Submission Payload

When the form is submitted, the following payload is POSTed to the action_url:

Server Response

The server can respond with the same action types as Button responses:

Nesting Rules

The form block can be placed inside:

Usage Notes

  • The WYSIWYG Builder uses the fields array format with its visual form designer — no JSON editing required
  • When using fields, a JSON Schema is generated internally for rendering via SchemaAutoForm
  • Both fields and schema formats produce identical rendered forms
  • Forms support client-side validation before submission
  • Server-side validation errors can be returned and displayed inline