XTend Documentation
Enable dark mode

XTend Developer Center

Build with XTend today

RMT Reference: Validation and Transitions

Validation declaratively blocks actions. Transitions describe the change between surface groups.

Syntax

OperatorFormAllowed contextsParametersFunctionDiagnosticsRelated operators
mode blockingmode blockingvalidationmode blockingBlocks target actions while fields are invalid.Unknown modes are reported.target action
target actiontarget action submitvalidationaction referenceSelects which action is validated.Target kind and reference must be present.action
fieldfield app.email required emailvalidationstate path, rulesDeclares a validated field.Only known rules are allowed.required, message
requiredrequiredfieldflagField must have a value.Only valid in field.message
emailemailfieldflagField must have email shape.Only valid in field.pattern
minLengthminLength 3fieldnumberSets minimum length.Value must follow.maxLength
maxLengthmaxLength 80fieldnumberSets maximum length.Value must follow.minLength
patternpattern "^[a-z]+$"fieldstringDeclares a pattern contract.Value must follow.email
messagemessage "Enter email"fieldstringProvides a usable validation message.Value must follow.field
includeinclude shared.emailvalidationvalidation referenceIncludes another validation group.Reference must exist.validation
trigger actiontrigger action submittransitionaction referenceStarts the surface change after an action.Trigger kind must be present.action
from surfacesfrom surfaces [form]transitionarray or valueDeclares outgoing surface group.Value must parse.to surfaces
to surfacesto surfaces [done]transitionarray or valueDeclares incoming surface group.Value must parse.from surfaces
use animationuse animation app.motiontransitionanimation referenceReuses a named AnimationEngine preset.Reference must name an animation record.animation
effecteffect slide-lefttransitioneffect nameSelects the visual change.Unknown effects can be catalog diagnostics.durationMs
durationMsdurationMs 220transitionnumberSets duration in milliseconds.Value must follow.easing
easingeasing "ease-out"transitionstringSets CSS easing.Value must follow.effect
timelinetimeline enter then exittransitiontimeline modeDeclares enter/exit sequencing.Unknown timeline modes are reported.effect
layoutKeylayoutKey "card"transitionstable keyBinds shared-element and layout-flip motion to a layout key.Required for layout-aware effects.shared-element, layout-flip
interruptinterrupt replacetransitioncancel, finish or replaceSelects how a running transition is interrupted.Unknown policies are reported.trigger action
reducedMotionreducedMotion fadetransitioninstant, fade or noneDeclares the fallback for reduced-motion hosts.Unknown policies are reported.durationMs
lane transitionlane transitiontransitionlane nameSchedules 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

(c) 2026 - CCS Networks | Powered by XRouter PHP Extension