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:

KeywordPurposeReference
$idIdentity and revision of a documentDocuments
$schemaDialect identifier of a documentDocuments

Expressions

Resolve a value anywhere one is expected:

KeywordsPurposeReference
$dataReference to a data field valueData References
$t $params $tagsReference to a translatable message, with interpolated values and tagsTranslation References
$message $paramsInline ICU pattern to format, with interpolated valuesInline Messages
$argReference to a scoped argumentScoped Arguments

Actions

Dispatch handlers on callbacks:

KeywordsPurposeReference
$action $argsHandler to dispatch, with the arguments passedActions

Control Flow

Select or repeat a value:

KeywordsPurposeReference
$if $matches $then $elseBinary conditional, tested by schema validationIf/Then/Else
$switch $case $defaultMulti-case conditional, discriminated by valueSwitch/Case/Default
$map $eachIteration, applying a template to each item of an arrayMaps

Form Fields

Bind a prop to a data field:

KeywordPurposeReference
$fieldTwo-way binding to a data fieldForm 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.

On this page