Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "LocalStorage",
"description": "Reads and updates local storage values.",
"type": "object",
"examples": [
{
"title": "Store and read a value",
"description": "In the playground LocalStorage writes to an in-memory scratch store, so an example cannot clobber a real user's Token. Real tenant apps get device-persistent state that survives reload.",
"document": {
"PresentationType": "Column",
"Children": [
{
"PresentationType": "Button",
"Text": "Save 'hello'",
"BorderRadius": 6,
"Color": "#FFFFFF",
"BackgroundColor": "#2F6FED",
"OnClick": {
"Handler": "LocalStorage",
"Action": "Put",
"Key": "greeting",
"Value": "hello",
"OnSuccess": {
"Handler": "SnackBar",
"Message": "Saved."
}
}
},
{
"PresentationType": "SizedBox",
"Height": 8
},
{
"PresentationType": "Button",
"Text": "Read it back",
"BorderRadius": 6,
"Color": "#FFFFFF",
"BackgroundColor": "#4B5563",
"OnClick": {
"Handler": "LocalStorage",
"Action": "Get",
"Key": "greeting",
"OnSuccess": {
"Handler": "Alert",
"Theme": "Primary",
"Title": "Value",
"Message": "{{ Value }}"
}
}
}
]
}
}
],
"x-version": "1.0",
"required": [
"Handler",
"Action",
"Key"
],
"properties": {
"Handler": {
"const": "LocalStorage"
},
"Action": {
"type": "string",
"enum": [
"Get",
"Put",
"Delete",
"Patch",
"RemoveItem"
]
},
"Key": {
"type": "string"
},
"Value": {},
"IdKey": {
"type": "string"
},
"IdValue": {
"type": "string"
},
"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\"><rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\"/><path d=\"M3 10h18\"/><circle cx=\"7\" cy=\"14.5\" r=\"1\"/></svg>",
"$id": "/schema/Actions/LocalStorage/1.0/index.json",
"x-family": "Actions",
"x-name": "LocalStorage",
"x-source-package": "zero-schema"
}
In the playground LocalStorage writes to an in-memory scratch store, so an example cannot clobber a real user's Token. Real tenant apps get device-persistent state that survives reload.
{
"PresentationType": "Column",
"Children": [
{
"PresentationType": "Button",
"Text": "Save 'hello'",
"BorderRadius": 6,
"Color": "#FFFFFF",
"BackgroundColor": "#2F6FED",
"OnClick": {
"Handler": "LocalStorage",
"Action": "Put",
"Key": "greeting",
"Value": "hello",
"OnSuccess": {
"Handler": "SnackBar",
"Message": "Saved."
}
}
},
{
"PresentationType": "SizedBox",
"Height": 8
},
{
"PresentationType": "Button",
"Text": "Read it back",
"BorderRadius": 6,
"Color": "#FFFFFF",
"BackgroundColor": "#4B5563",
"OnClick": {
"Handler": "LocalStorage",
"Action": "Get",
"Key": "greeting",
"OnSuccess": {
"Handler": "Alert",
"Theme": "Primary",
"Title": "Value",
"Message": "{{ Value }}"
}
}
}
]
}