Keywords
The reserved $-prefixed vocabulary of the language.
The language reserves every $-prefixed key as a keyword. Everything else
is bare and defined by the dialect: an element's type, its props, and
the prop names inside props. Keywords fall into five groups.
Document
Identify a schema and its dialect:
| Keyword | Purpose | Reference |
|---|---|---|
$id | Identity and revision of a document | Documents |
$schema | Dialect identifier of a document | Documents |
Expressions
Resolve a prop value:
| Keyword | Purpose | Reference |
|---|---|---|
$data | Reference to a data field value | Data References |
$t | Reference to a translatable message | Translation References |
$params | Values interpolated into a message | Translation References |
$tags | Elements rendering a message's tags | Translation References |
$arg | Reference to a scoped argument | Scoped Arguments |
Binding
Bind a prop to a data field:
| Keyword | Purpose | Reference |
|---|---|---|
$field | Two-way binding to a data field | Form Fields |
$field appears in the same value positions as expressions, but it does
more than read: it resolves a value and registers a two-way binding
with form state. Every other value-position keyword is a pure read.
Actions
Dispatch handlers on callbacks:
| Keyword | Purpose | Reference |
|---|---|---|
$action | Name of the handler to dispatch | Actions |
$args | Arguments passed to the handler | Actions |
Control flow
Select or repeat a value:
| Keyword | Purpose | Reference |
|---|---|---|
$if | Binary conditional (schema validation) | If/Then/Else |
$then | Value to use if the condition matches | If/Then/Else |
$else | Value to use if it does not match | If/Then/Else |
$switch | Multi-case conditional | Switch/Case/Default |
$case | Case mapping for a switch | Switch/Case/Default |
$default | Default branch for a switch | Switch/Case/Default |
$map | Source array to map over | Maps |
$each | Template applied to each mapped item | Maps |
Some keywords are dependent and only valid alongside the keyword that
governs them: $then and $else accompany $if; $case and $default
accompany $switch; $each accompanies $map; $params and $tags
accompany $t; $args accompanies $action.
Scoped argument names
Scoped arguments are reserved names, not keywords: they never appear as
keys, only as string values read through the $arg keyword. An enclosing
construct injects them into the scope beneath it:
| Name | Injected by | Reference |
|---|---|---|
$item | Maps | Scoped Arguments |
$index | Maps | Scoped Arguments |
$content | Translation tags | Translation References |
$0, $1 | Actions | Scoped Arguments |
Structure
Bare, no $: type identifies an element; props carries its
configuration. Every other bare key inside props is a dialect-defined
prop.