Interactiontemplate
Overview
interactionTemplate reuses events, animations, state styles, and some common props without producing a runtime view; it expands only in the parser stage. After a node references it via interactionRefs, the template's commonProps, stateStyles, events, and animations are merged into the node.
Fields
Key |
Type |
Default |
Required |
Description |
|---|---|---|---|---|
|
string |
none |
Yes |
Fixed to |
|
string |
none |
Yes |
Template id |
|
object |
|
No |
Default common props; node-local fields take precedence |
|
object |
|
No |
Default state styles; node-local fields take precedence |
|
object[] |
|
No |
Prepended to the node's events |
|
object[] |
|
No |
Prepended to the node's animations |
{
"type": "interactionTemplate",
"id": "press.scale",
"commonProps": {"pressLock": false, "pivotX": "50%", "pivotY": "50%"},
"events": [
{"type": "pressed", "effects": [{"type": "startAnimation", "animationId": "press_down"}]},
{"type": "released", "effects": [{"type": "startAnimation", "animationId": "press_up"}]}
],
"animations": [
{"id": "press_down", "trigger": "manual", "property": "scale", "fromMode": "current", "to": 236},
{"id": "press_up", "trigger": "manual", "property": "scale", "fromMode": "current", "to": 256}
]
}