Computed Values
Derive dynamic prop values using registered functions or string templates.
$template — String Interpolation
Use { "$template": "..." } to embed state values into a string. References use ${/path} syntax where the path is a JSON Pointer:
If state is { "user": { "name": "Alice" }, "inbox": { "count": 3 } }, the text renders as "Hello, Alice! You have 3 messages."
Missing paths resolve to an empty string.
$computed — Registered Functions
Use { "$computed": "<name>", "args": { ... } } to call a named function registered in your catalog. Each arg can be a literal value or any prop expression ($state, $item, $cond, etc.):
Registering Functions
Functions are registered in the catalog and provided at runtime.
Catalog definition (for AI prompt generation):
Runtime implementation:
Using with createRenderer
Combining Expressions
$computed args can use any expression type. This example computes a total from repeat item fields:
Next
- Watchers — react to state changes with cascading actions
- Data Binding — all expression types
- Validation — validate form inputs