Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Patch",
"description": "Patches another patchable UI target.",
"type": "object",
"examples": [
{
"title": "Patch another widget's props",
"description": "Patch updates any widget by its Name/PresentationId, without rebuilding the whole page. Give the target a Name, then Patch it. A trailing * on Target patches every widget with that prefix.",
"document": {
"PresentationType": "Column",
"Children": [
{
"PresentationType": "Text",
"Name": "banner",
"Text": "Old text",
"FontSize": 20,
"FontWeight": "bold"
},
{
"PresentationType": "SizedBox",
"Height": 12
},
{
"PresentationType": "Button",
"Text": "Patch the banner",
"BorderRadius": 6,
"Color": "#FFFFFF",
"BackgroundColor": "#2F6FED",
"OnClick": {
"Handler": "Patch",
"Target": "banner",
"Overrides": {
"Text": "New text!",
"Color": "#0C29AB"
}
}
}
]
}
}
],
"x-version": "1.0",
"required": [
"Handler",
"Target",
"Overrides"
],
"properties": {
"Handler": {
"const": "Patch"
},
"Target": {
"type": "string"
},
"Overrides": {
"type": "object"
},
"OnSuccess": {
"$ref": "/schema/Actions/Action/1.0/index.json"
},
"OnFailure": {
"$ref": "/schema/Actions/Action/1.0/index.json"
}
},
"additionalProperties": false,
"x-icon": "<svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M4 20h4L19 9l-4-4L4 16z\"/><path d=\"M14.5 6.5l3 3\"/></svg>",
"$id": "/schema/Actions/Patch/1.0/index.json",
"x-family": "Actions",
"x-name": "Patch",
"x-source-package": "zero-schema"
}
Patch updates any widget by its Name/PresentationId, without rebuilding the whole page. Give the target a Name, then Patch it. A trailing * on Target patches every widget with that prefix.
{
"PresentationType": "Column",
"Children": [
{
"PresentationType": "Text",
"Name": "banner",
"Text": "Old text",
"FontSize": 20,
"FontWeight": "bold"
},
{
"PresentationType": "SizedBox",
"Height": 12
},
{
"PresentationType": "Button",
"Text": "Patch the banner",
"BorderRadius": 6,
"Color": "#FFFFFF",
"BackgroundColor": "#2F6FED",
"OnClick": {
"Handler": "Patch",
"Target": "banner",
"Overrides": {
"Text": "New text!",
"Color": "#0C29AB"
}
}
}
]
}