Keywords
The reserved vocabulary of the language.
The language reserves two kinds of keys: every $-prefixed key, which is
a keyword, and the two structural keys type and props. The dialect
defines everything else: which element types exist, and which prop names
appear inside props. The keywords fall into five groups.
Coupled keywords share a row: the first keyword governs the construct, and the ones after it are only valid alongside it.
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 value anywhere one is expected:
| Keywords | Purpose | Reference |
|---|---|---|
$data | Reference to a data field value | Data References |
$t $params $tags | Reference to a translatable message, with interpolated values and tags | Translation References |
$message $params | Inline ICU pattern to format, with interpolated values | Inline Messages |
$arg | Reference to a scoped argument | Scoped Arguments |
Actions
Dispatch handlers on callbacks:
| Keywords | Purpose | Reference |
|---|---|---|
$action $args | Handler to dispatch, with the arguments passed | Actions |
Control Flow
Select or repeat a value:
| Keywords | Purpose | Reference |
|---|---|---|
$if $matches $then $else | Binary conditional, tested by schema validation | If/Then/Else |
$switch $case $default | Multi-case conditional, discriminated by value | Switch/Case/Default |
$map $each | Iteration, applying a template to each item of an array | Maps |
Form Fields
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.