RMT Reference: Primitives
Primitives are the stable App Platform records in RMT vNext.
Syntax
Allowed contexts
Primitives may appear top-level, in template and partly in primitive-scoped surfaces. They declare records; they do not execute host code.
Parameters
The main parameters are identifiers, source references, type names, catalog values and static strings.
Description
Primitives bridge RMT authoring and Core format. They compile to state, selector, datasource, action, portal, overlay, resource, validation, transition and surface records.
Examples
template reference.primitives {
state app.status type object preserve {
initial {
text "Ready"
}
}
selector app.statusView from state app.status {
output StatusView
}
datasource app.messages from endpoint "/api/messages" {
method GET
result list
fallback fixture messages.fallback
}
action app.refresh {
input id string
status app.status
reduce state.app.status.text = "Loading"
emit app.refreshed with id input.id
}
portal app.root root "#app" layer surface
overlay app.toast kind toast portal app.root
resource app.timer kind timer owner surface.home {
dispose clear
}
validation app.form {
mode blocking
target action app.refresh
field app.email required email message "Valid email"
}
animation app.motion {
effect pop
durationMs 180
reducedMotion fade
}
transition app.next {
trigger action app.refresh
from surfaces [home]
to surfaces [done]
use animation app.motion
effect fade
durationMs 120
easing "ease-out"
interrupt replace
reducedMotion fade
lane transition
}
surface home kind card component x-status {
portal app.root
lane visible weight 80 {
hydrate status.card from selector app.statusView
}
}
}
Diagnostics
Missing owners, unknown references, unkeyed repeaters and actions without reducers or payload contracts are reported semantically.
Related operators
template, surface, lane, from, when, payload, trust boundary.
Related reading
The RMT reference index shows where primitive records can legally appear in a document. Related article