app.json reference
app.json fully describes a hosted app: which components it shows, where the data comes from, what happens on a click. The builder writes this file; in the Code area you can edit it directly. Both are equivalent – the builder can do everything the file can.
This reference is generated from the runtime itself (@methacore/runtime, schema version 1). The JSON schema is at https://methacore.de/schemas/apps/app/v1.json; with "$schema" you get autocompletion in any editor.
Structure
{
"$schema": "https://methacore.de/schemas/apps/app/v1.json",
"schemaVersion": 1,
"name": "Pinnwand",
"auth": { "clientId": "cl_7d2e41a9", "scopes": ["mc.apps.storage:read", "mc.apps.storage:write"] },
"initialState": { "entwurf": "" },
"root": { "id": "root", "type": "Stack", "children": [] }
}
| Field | Type | Required | Meaning |
|---|---|---|---|
$schema | string | no | Address of the JSON schema, for editors only |
schemaVersion | 1 | yes | Version of the format. The runtime rejects other values. |
name | string | no | Name of the app. The Studio keeps it in sync with the listing in the Artim Developer Portal. |
auth.clientId | string | for data | OAuth client of the app. Without it, the app cannot load any data. |
auth.scopes | string[] | for data | Scopes members consent to on first open. See Permissions. |
initialState | object | no | Initial values of the state |
root | node | yes | The top-level component, usually a Stack |
Nodes
Every component is a node:
{
"id": "speichern",
"type": "Button",
"props": { "label": "Speichern", "variant": "filled" },
"bind": [],
"on": { "click": [{ "type": "toast", "message": "Gespeichert" }] },
"children": []
}
| Field | Meaning |
|---|---|
id | unique across the whole app. Appears in the HTML as data-mc-id – use it to target the component in styling.css. |
type | one of the components below |
props | properties. Every value may contain {{…}} expressions. |
bind | data bindings: data sources loaded at start |
on | events with a list of actions |
children | child nodes – containers only: Stack, Grid, Card, Tabs, List |
Additional fields on a node are not allowed; the runtime reports an error instead of silently ignoring them.
Components
| Component | In the builder | Group | Children | Events |
|---|---|---|---|---|
Stack | Stack | Layout | yes | load |
Grid | Grid | Layout | yes | – |
Card | Card | Layout | yes | – |
Tabs | Tabs | Layout | yes | change |
Heading | Heading | Content | – | – |
Text | Text | Content | – | – |
Image | Image | Content | – | – |
Button | Button | Form | – | click |
TextInput | Text field | Form | – | change, submit |
Select | Select | Form | – | change |
Checkbox | Checkbox | Form | – | change |
DateInput | Date | Form | – | change |
Table | Table | Data | – | rowClick |
List | List | Data | yes | click |
Chart | Chart | Data | – | – |
Every component has two properties:
| Property | Meaning |
|---|---|
visible | Expression that shows or hides the component. It is hidden for false, "false", an empty text or when the expression points to nothing. If the property is missing, it is always visible. |
className | custom CSS classes, separated by spaces. In the builder, the field is called “CSS class”. |
Stack – Stack
| Property | In the builder | Meaning |
|---|---|---|
gap | Gap (px) | Gap between the elements in pixels. New in the builder: 12. |
direction | Direction | Whether the elements are stacked vertically or side by side. Values: column (Vertical), row (Side by side). |
label | Tab title (in Tabs) | Label shown next to or above the element. |
align | code only | Alignment across the direction: start, center, end or stretch. |
justify | code only | Distribution along the direction: start, center, end or between. |
The load event only works on the root node. A stack needs label only as a child of Tabs.
Grid – Grid
| Property | In the builder | Meaning |
|---|---|---|
columns | Columns | How many columns sit side by side. New in the builder: 2. |
minWidth | Minimum width per column (px) | No column gets narrower; below that, the grid wraps. |
gap | Gap (px) | Gap between the elements in pixels. New in the builder: 12. |
label | Tab title (in Tabs) | Label shown next to or above the element. |
With minWidth, the grid wraps by itself; otherwise columns (1–12) applies.
Card – Card
| Property | In the builder | Meaning |
|---|---|---|
title | Title | Heading of the card. New in the builder: "Karte". |
label | Tab title (in Tabs) | Label shown next to or above the element. |
A card needs label only as a child of Tabs.
Tabs – Tabs
| Property | In the builder | Meaning |
|---|---|---|
defaultTab | code only | Index of the tab that is open first, starting at 0. |
Every child is a tab; its props.label is the label and is required. change delivers { value: <Index> }.
Heading – Heading
| Property | In the builder | Meaning |
|---|---|---|
text | Text | Displayed text. {{…}} inserts values from the state. New in the builder: "Überschrift". |
level | Level | Size of the heading, H1 is the largest. Values: 1 (H1), 2 (H2), 3 (H3), 4 (H4). New in the builder: 2. |
Text – Text
| Property | In the builder | Meaning |
|---|---|---|
text | Text | Use {{state.key}} to insert values. New in the builder: "Text". |
size | Size | Font size of the text. Values: sm (Small), md (Normal), lg (Large). |
muted | Muted | Grey, subdued text for secondary information. |
align | code only | Alignment: left, center or right. |
Image – Image
| Property | In the builder | Meaning |
|---|---|---|
src | Image URL (https) | Address of the image, must start with https. |
alt | Alternative text | Description for screen readers and for when the image does not load. |
width | Width (px) | Width in pixels, empty for full width. |
radius | Corners (px) | Corner rounding in pixels. |
Only addresses with https: or data:image/ are loaded.
Button – Button
| Property | In the builder | Meaning |
|---|---|---|
label | Label | Label shown next to or above the element. New in the builder: "Button". |
variant | Variant | Appearance of the button. Values: filled (Filled), light (Light), outline (Outline), subtle (Subtle). |
fullWidth | Full width | Takes up the entire available width. |
disabled | Disabled | Locks the element so it cannot be used. |
color | code only | red makes a red button, e.g. for deleting (class .mc-button--danger). |
The class is .mc-button--primary for filled buttons and .mc-button--secondary for light, outline and subtle buttons.
TextInput – Text field
| Property | In the builder | Meaning |
|---|---|---|
label | Label | Label shown next to or above the element. New in the builder: "Textfeld". |
model | State key | The entered value ends up in this state key. |
placeholder | Placeholder | Grey hint in the empty field, e.g. an example. |
type | Type | Kind of input, controls keyboard and validation. Values: text (Text), email (Email), number (Number), search (Search). |
required | Required | The field must be filled in. |
value | code only | Initial value if no model is set. |
disabled | code only | Locks the field. |
change fires on every input with { value }, submit on Enter. With type: "number", a number (or null) ends up in the state.
Select – Select
| Property | In the builder | Meaning |
|---|---|---|
label | Label | Label shown next to or above the element. New in the builder: "Auswahl". |
model | State key | The entered value ends up in this state key. |
options | Options | List such as ["A", "B"] or [{"value": "a", "label": "A"}], or {{state.liste}}. New in the builder: ["Option 1","Option 2"]. |
optionValue | Field for the value | Field of each row that is stored on selection. |
optionLabel | Field for the text | Field of each row that is shown in the selection. |
placeholder | Placeholder | Grey hint in the empty field, e.g. an example. |
value | code only | Initial value if no model is set. |
disabled | code only | Locks the select. |
options is a list of texts or objects. With optionValue and optionLabel, a data source fits directly: "options": "{{state.gruppen}}", "optionValue": "id", "optionLabel": "name".
Checkbox – Checkbox
| Property | In the builder | Meaning |
|---|---|---|
label | Label | Label shown next to or above the element. New in the builder: "Checkbox". |
model | State key | The entered value ends up in this state key. |
value | code only | Initial value if no model is set. |
disabled | code only | Locks the checkbox. |
true or false ends up in the state; change delivers { value }.
DateInput – Date
| Property | In the builder | Meaning |
|---|---|---|
label | Label | Label shown next to or above the element. New in the builder: "Datum". |
model | State key | The entered value ends up in this state key. |
withTime | With time | Also ask for the time. |
placeholder | code only | Grey hint in the empty field. |
required | code only | The field must be filled in. |
disabled | code only | Locks the field. |
value | code only | Initial value if no model is set. |
The browser's value ends up in the state: 2026-10-02, or with time 2026-10-02T17:00.
Table – Table
| Property | In the builder | Meaning |
|---|---|---|
data | Data source (expression) | List from the state that the table shows. |
columns | Columns (JSON) | e.g. [{"key": "name", "label": "Name"}]. Empty = all fields. |
empty | Text without entries | Shown as long as there are no entries. New in the builder: "Keine Einträge". |
columns may also be a list of field names: ["title", "start"]. On rowClick, the row is available as item (and event) in the actions.
List – List
| Property | In the builder | Meaning |
|---|---|---|
data | Data source (expression) | List from the state whose entries the list shows. |
itemText | Text per entry (expression) | Applies only without child elements. {{item.feld}} accesses the entry. |
empty | Text without entries | Shown as long as there are no entries. |
Without children, each entry shows itemText. With children, they are rendered per entry; inside them, {{item}} and {{index}} are available. itemText is evaluated per entry. click delivers the entry as item.
Chart – Chart
| Property | In the builder | Meaning |
|---|---|---|
data | Data source (expression) | List from the state that the chart shows. |
x | Field for label | Field name of each row for the label. |
y | Field for value | Field name of each row for the numeric value. |
kind | Kind | How the chart is drawn. Values: bar (Bar), line (Line). New in the builder: "bar". |
height | Height (px) | Height in pixels. |
color | code only | Colour of the bars or the line. Default: var(--mc-color-primary). |
title | code only | Description of the chart for screen readers. |
A plain SVG chart. Labels come from the field x (default label), values from y (default value).
Expressions {{…}}
Expressions insert values from the state or the context. They are plain paths: no arithmetic, no comparisons, no function calls. Anything that needs more belongs in a handler.
{{state.profil.firstName}} Wert aus dem State
{{state.termine[0].title}} Listeneintrag über den Index (auch state.termine.0.title)
{{item.name}} Eintrag einer Liste oder angeklickte Tabellenzeile
{{event.value}} Wert eines change- oder submit-Ereignisses
{{context.organisation.name}} Kontext des Hosts
What is available:
| Name | Content |
|---|---|
state | the app's entire state |
state.$loading | true per state key of a binding while it is loading, e.g. {{state.$loading.termine}} |
context | from the host: organisation (id, name), user (id, firstName), theme (light/dark), locale (de/en), target (dashboard/mobile) |
item, index | in children of a List and in actions of rowClick or of a list's click |
event | in actions: the payload of the event |
Two rules determine the result:
- If the expression stands alone, you get the value itself – a list stays a list, a number a number. This is how you pass
{{state.termine}}to a table. - If it is part of a text, it becomes text:
"Hallo {{state.profil.firstName}}!". Objects then appear as JSON, missing values as empty text.
Paths to __proto__, prototype or constructor always return nothing.
Data bindings
A binding loads a data source when the app starts and stores the result in the state:
"bind": [
{ "source": "me.events", "to": "termine", "pick": "items" },
{ "source": "storage.list", "params": { "collection": "notizen", "scope": "org" }, "to": "notizen", "pick": "items" }
]
| Field | Required | Meaning |
|---|---|---|
source | yes | Name of the data source, e.g. me.profile |
params | no | Parameters of the source; values may contain {{…}} |
to | yes | State key that receives the result. Dots separate levels: daten.termine. Must start with a letter, _ or $. |
pick | no | Path in the result that is stored, e.g. items for lists or card for the membership card |
All bindings of all nodes start simultaneously as soon as the app has loaded. The parameters are evaluated once against the initial state. After that, the load actions of the root node run. If a binding fails, the app shows a red notice; the others continue.
To reload data later – for example after saving – use the call action with the same to.
Events
| Event | In the builder | Components | event |
|---|---|---|---|
load | On load | Stack | – |
click | On click | Button, List | for List the clicked entry, otherwise – |
change | On change | TextInput, Select, Checkbox, DateInput, Tabs | { value }, for Tabs the index |
submit | On submit (Enter) | TextInput | { value } |
rowClick | On row click | Table | the clicked row |
load only works on the root node. An event runs its actions one after another; if one of them throws an error, the chain stops and the app shows “Action failed: …”.
Actions
| Action | In the builder | Purpose |
|---|---|---|
call | Fetch data | call a data source, optionally store the result in the state |
export | Export | download or share a list as CSV, XLSX or PDF |
navigate | Navigate | send the host to one of its pages |
setState | Set state | set a state key |
toast | Show notice | show a notice in the host |
script | Script handler (main.js) | call a handler from main.js |
call – Fetch data
{ "type": "call", "source": "storage.put",
"params": { "collection": "notizen", "key": "{{state.neu.key}}", "value": "{{state.neu.text}}" } }
| Field | Required | Meaning |
|---|---|---|
source | yes | Data source |
params | no | Parameters, with expressions |
to | no | State key for the result; without to, the result is discarded |
pick | no | Path in the result |
export – Export
{ "type": "export", "format": "csv", "data": "{{state.termine}}", "filename": "termine-{{context.organisation.name}}",
"columns": [{ "key": "title", "label": "Termin" }, { "key": "start", "label": "Beginn" }], "excel": true }
| Field | Required | Meaning |
|---|---|---|
format | yes | csv, xlsx or pdf |
data | yes | Expression that yields a list |
filename | yes | File name; the runtime adds the extension |
columns | no | Columns with key and optional label; if omitted, all fields of the first row |
excel | no | CSV only: semicolon and BOM for German Excel (default) |
title | no | PDF only: heading above the table |
The file goes via the bridge to the host, which downloads it (dashboard) or shares it (phone).
navigate – Navigate
{ "type": "navigate", "path": "/apps" }
Asks the host to switch to one of its own pages – a path of the dashboard or the member app, not an external address. Targets that do not exist in the member app are rejected with an error. Outside a host, the runtime only sets the page's hash.
setState – Set state
{ "type": "setState", "key": "auswahl", "value": "{{item}}" }
value may be an expression or a fixed value, including an object. Without value, the key is cleared.
toast – Show notice
{ "type": "toast", "message": "{{state.notizen.length}} Notizen geladen", "color": "green" }
color: green, blue, orange or red. The host shows the notice in its own style.
script – Handler from main.js
{ "type": "script", "handler": "speichern", "args": { "collection": "notizen" } }
Calls the exported function of the same name from main.js. args is evaluated beforehand. More under main.js & handlers.
Example: notice board
An app that stores and shows the club's notes in app storage – without any main.js:
{
"schemaVersion": 1,
"name": "Pinnwand",
"auth": { "clientId": "cl_7d2e41a9", "scopes": ["mc.apps.storage:read", "mc.apps.storage:write"] },
"initialState": { "neu": "" },
"root": {
"id": "root",
"type": "Stack",
"bind": [{ "source": "storage.list", "params": { "collection": "pinnwand" }, "to": "notizen", "pick": "items" }],
"children": [
{ "id": "titel", "type": "Heading", "props": { "text": "Pinnwand {{context.organisation.name}}", "level": 2 } },
{
"id": "zeile",
"type": "Stack",
"props": { "direction": "row", "gap": 8 },
"children": [
{ "id": "eingabe", "type": "TextInput", "props": { "label": "Neue Notiz", "model": "neu" } },
{
"id": "anheften",
"type": "Button",
"props": { "label": "Anheften" },
"on": {
"click": [
{ "type": "call", "source": "storage.put",
"params": { "collection": "pinnwand", "key": "{{state.neu}}", "value": "{{state.neu}}" } },
{ "type": "call", "source": "storage.list", "params": { "collection": "pinnwand" }, "to": "notizen", "pick": "items" },
{ "type": "setState", "key": "neu", "value": "" }
]
}
}
]
},
{
"id": "liste",
"type": "List",
"props": { "data": "{{state.notizen}}", "itemText": "{{item.value}}", "empty": "Noch nichts angeheftet" }
}
]
}
}
Here, the key is the text itself – this keeps the example short, but only allows characters from A–Z a–z 0–9 _ -. A real notice board generates keys in a handler.
Validation
The runtime validates app.json on load, the Studio already while you type. Typical messages:
| Message | Cause |
|---|---|
schemaVersion must be 1 | wrong or missing version |
root (x): duplicate id "x" | two nodes with the same id |
unknown component type "Foo" | typo in type |
root.children[0]: a tab needs props.label | a tab without a label |
bind[0]: invalid state key "1termine" | to starts with a digit or contains spaces |
on.click[0]: unknown action type "open" | the action does not exist |
invalid handler name "mein-handler" | handler names follow the rules for JavaScript identifiers |
The Studio repairs older documents itself when opening them: empty state keys get a readable name, tabs without a title are called “Tab 1”, “Tab 2” and so on.