UINode (the building block for every element), EventConfig (the handler attached to component events), and ForConfig (the iterator for rendering lists). This page documents every field on these types with descriptions, types, and examples.
Understanding the schema structure is essential for building V2 forms. Each node in the nodes array describes a single component instance, including its props, bindings, event handlers, conditional rendering, and children. The renderer walks this tree top-down, resolving bindings and evaluating conditions at each level.
For a hands-on introduction, start with the Getting Started guide.
DataFormV2
The top-level form object extends the standardDataForm model with V2-specific fields.
| Field | Type | Required | Description |
|---|---|---|---|
version | "1" | "2" | No | Set to "2" to enable V2 rendering. If omitted, the presence of a non-empty nodes array also triggers V2 mode. |
nodes | UINode[] | Yes | The root-level component tree. |
scripts | Record<string, string> | No | Named script registry. Keys are script names, values are JavaScript function bodies. |
scriptModules | Record<string, ScriptModule> | No | Named script modules with metadata, input declarations, and debounce settings. |
bridge | BridgeConfig | No | Configuration for the kodexa.* bridge API. |
UINode
AUINode represents a single component in the form tree. It is the fundamental building block of V2 forms.
| Field | Type | Required | Description |
|---|---|---|---|
component | string | Yes | The component to render, in namespace:type format (e.g., "card:cardPanel") or just the type name (e.g., "cardPanel"). |
props | Record<string, any> | No | Static properties passed directly to the component. These are not evaluated as expressions. |
bindings | Record<string, string> | No | Dynamic properties. Each value is a JavaScript expression evaluated against the data context (ctx). Results are merged with props, with bindings taking precedence. |
computed | Record<string, string> | No | Properties derived from named scripts. Each value is a script name from the scripts registry. The script is called with the current data context and its return value becomes the prop. |
events | Record<string, EventConfig | EventConfig[]> | No | Event handlers. Keys are event names (e.g., "click", "change"). Values are a single EventConfig or an array of them. |
children | UINode[] | No | Child nodes rendered inside this component’s default slot. |
slots | Record<string, UINode[]> | No | Named slot content. Keys are slot names, values are arrays of UINode to render in that slot. |
if | string | No | Conditional rendering expression. The node is only rendered when this expression evaluates to a truthy value. |
show | string | No | Visibility expression. Unlike if, the component is still mounted but hidden when the expression is falsy. |
for | ForConfig | No | Loop configuration. Renders this node once for each item in the source collection. |
key | string | No | Unique key for list rendering. Helps the renderer efficiently update the DOM when items change. |
class | string | Record<string, string> | No | CSS classes. Can be a static string or an object mapping class names to binding expressions. |
style | Record<string, any> | string | No | Inline styles as a CSS string or an object of style properties. |
ref | string | No | A reference name for this node, used with kodexa.form.getNodeRef() to programmatically interact with it. |
meta | NodeMeta | No | Design-time metadata that does not affect rendering. |
Full UINode Example
NodeMeta
Design-time metadata attached to a node. This information is used by form editors and does not affect runtime rendering.| Field | Type | Required | Description |
|---|---|---|---|
label | string | No | Human-readable label for the node, shown in design tools. |
description | string | No | Longer description of the node’s purpose. |
designOnly | boolean | No | When true, the node is only visible in the form designer, not at runtime. |
category | string | No | Category for grouping in the designer palette. |
EventConfig
AnEventConfig defines what happens when a component emits an event. Multiple configs can be attached to the same event using an array.
| Field | Type | Required | Description |
|---|---|---|---|
type | "script" | "scriptRef" | "emit" | "store-action" | "bus-event" | Yes | The handler type. See Event Handling for details on each. |
target | string | Yes | The target depends on type: a script expression, a script name, an event name, an action name, or a bus event name. |
params | Record<string, any> | No | Additional parameters passed to the handler. |
condition | string | No | A JavaScript expression that must evaluate to truthy for the handler to execute. |
debounce | number | No | Milliseconds to debounce the handler. The handler will not fire until this many milliseconds have passed since the last trigger. |
EventConfig Examples
Inline script:ForConfig
AForConfig turns a single UINode into a list renderer. The node is rendered once for each item in the source collection, with loop variables injected into the data context.
| Field | Type | Required | Description |
|---|---|---|---|
source | string | Yes | A JavaScript expression that evaluates to an array (e.g., "ctx.dataObjects"). |
itemAs | string | Yes | The variable name for the current item, injected into the data context (e.g., "$item"). |
indexAs | string | No | The variable name for the current index (e.g., "$index"). Defaults to "$index" if omitted. |
key | string | Yes | An expression evaluated per item to produce a unique key (e.g., "$item.uuid"). |
ForConfig Example
BridgeConfig
Controls thekodexa.* bridge API available to scripts.
| Field | Type | Required | Description |
|---|---|---|---|
permissions | BridgePermission[] | No | List of permissions to grant. Scripts that call methods requiring a permission not in this list will throw an error. |
apiBaseUrl | string | No | Base URL for kodexa.http methods. Defaults to "/api". |
maxExecutionMs | number | No | Maximum execution time in milliseconds for any single script evaluation. Defaults to 1000. |
BridgePermission Values
| Permission | Grants Access To |
|---|---|
data:read | kodexa.data.getDataObjects, getDataObject, getAttributes, getAttribute, getTagMetadata, getTaxonomies |
data:write | kodexa.data.setAttribute, addDataObject, deleteDataObject |
navigation | kodexa.navigation.focusAttribute, scrollToNode, switchView |
formState | kodexa.form.get, set, getNodeRef |
http:get | kodexa.http.get |
http:post | kodexa.http.post |
ScriptModule
AScriptModule provides richer metadata for named scripts, beyond what the flat scripts registry offers.
| Field | Type | Required | Description |
|---|---|---|---|
source | string | Yes | The JavaScript function body. |
description | string | No | Human-readable description of what the script does. |
inputs | Record<string, string> | No | Declares expected input types. Keys are parameter names, values are type descriptions. |
returns | string | No | Describes the return type. |
debounce | number | No | Default debounce in milliseconds when this script is invoked. |
Common Patterns
Conditional Rendering
Useif to conditionally include a node in the tree:
Visibility Toggle
Useshow to keep a node mounted but hidden:
Named Slots
Useslots to place content in specific named slots of a component:
