RMT Reference: Validation and Transitions
Validation declaratively blocks actions. Transitions describe the change between surface groups.
Syntax
| Operator | Form | Allowed contexts | Parameters | Function | Diagnostics | Related operators |
|---|
mode blocking | mode blocking | validation | mode blocking | Blocks target actions while fields are invalid. | Unknown modes are reported. | target action |
target action | target action submit | validation | action reference | Selects which action is validated. | Target kind and reference must be present. | action |
field | field app.email required email | validation | state path, rules | Declares a validated field. | Only known rules are allowed. | required, message |
required | required | field | flag | Field must have a value. | Only valid in field. | message |
email | email | field | flag | Field must have email shape. | Only valid in field. | pattern |
minLength | minLength 3 | field | number | Sets minimum length. | Value must follow. | maxLength |
maxLength | maxLength 80 | field | number | Sets maximum length. | Value must follow. | minLength |
pattern | pattern "^[a-z]+$" | field | string | Declares a pattern contract. | Value must follow. | email |
message | message "Enter email" | field | string | Provides a usable validation message. | Value must follow. | field |
include | include shared.email | validation | validation reference | Includes another validation group. | Reference must exist. | validation |
trigger action | trigger action submit | transition | action reference | Starts the surface change after an action. | Trigger kind must be present. | action |
from surfaces | from surfaces [form] | transition | array or value | Declares outgoing surface group. | Value must parse. | to surfaces |
to surfaces | to surfaces [done] | transition | array or value | Declares incoming surface group. | Value must parse. | from surfaces |
use animation | use animation app.motion | transition | animation reference | Reuses a named AnimationEngine preset. | Reference must name an animation record. | animation |
effect | effect slide-left | transition | effect name | Selects the visual change. | Unknown effects can be catalog diagnostics. | durationMs |
durationMs | durationMs 220 | transition | number | Sets duration in milliseconds. | Value must follow. | easing |
easing | easing "ease-out" | transition | string | Sets CSS easing. | Value must follow. | effect |
timeline | timeline enter then exit | transition | timeline mode | Declares enter/exit sequencing. | Unknown timeline modes are reported. | effect |
layoutKey | layoutKey "card" | transition | stable key | Binds shared-element and layout-flip motion to a layout key. | Required for layout-aware effects. | shared-element, layout-flip |
interrupt | interrupt replace | transition | cancel, finish or replace | Selects how a running transition is interrupted. | Unknown policies are reported. | trigger action |
reducedMotion | reducedMotion fade | transition | instant, fade or none | Declares the fallback for reduced-motion hosts. | Unknown policies are reported. | durationMs |
lane transition | lane transition | transition | lane name | Schedules the change on the transition lane. | Lane must exist or be cataloged. | lane |
Allowed contexts
Validation clauses belong only in validation. Transition clauses belong only in transition.
Parameters
Validation fields point to state paths. Transitions point to surface identifiers and action triggers.
Description
Validation and transitions stay declarative so form flow and surface changes remain inspectable.
Examples
template reference.validation {
state contact.email type string initial ""
state app.status type object preserve {
initial {
text "Ready"
}
}
action contact.next {
input email string
reduce state.app.status.text = "Next"
emit contact.nextRequested with email input.email
}
validation contact.form {
mode blocking
target action contact.next
field contact.email required email minLength 3 maxLength 80 pattern ".+@.+" message "Enter a valid email."
include shared.email
}
animation contact.motion {
effect fade
durationMs 180
reducedMotion fade
}
transition contact.toSummary {
trigger action contact.next
from surfaces [contact.form]
to surfaces [contact.summary]
use animation contact.motion
effect slide-left
durationMs 220
easing "ease-out"
timeline enter then exit
layoutKey "contact-summary"
interrupt replace
reducedMotion fade
lane transition
}
portal app.root root "#app" layer surface
surface contact.form kind form component x-form {
portal app.root
lane user-blocking weight 85 {
mount contact.form from endpoint contact.form
}
}
}
Diagnostics
Unknown field rules, missing action targets, incomplete transition targets and missing layoutKey values for layout-aware effects are reported.
action, field, surface, lane, effect, payload, animation, use animation.
The RMT reference index points from validation and transition records to their related expression forms. The AnimationEngine guide connects these operators to a complete AOT and runtime example. Related article