DocumentationMethacore Apps

app.json reference

14 min read · last updated 23 September 2026

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": [] }
}
FieldTypeRequiredMeaning
$schemastringnoAddress of the JSON schema, for editors only
schemaVersion1yesVersion of the format. The runtime rejects other values.
namestringnoName of the app. The Studio keeps it in sync with the listing in the Artim Developer Portal.
auth.clientIdstringfor dataOAuth client of the app. Without it, the app cannot load any data.
auth.scopesstring[]for dataScopes members consent to on first open. See Permissions.
initialStateobjectnoInitial values of the state
rootnodeyesThe 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": []
}
FieldMeaning
idunique across the whole app. Appears in the HTML as data-mc-id – use it to target the component in styling.css.
typeone of the components below
propsproperties. Every value may contain {{…}} expressions.
binddata bindings: data sources loaded at start
onevents with a list of actions
childrenchild 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

ComponentIn the builderGroupChildrenEvents
StackStackLayoutyesload
GridGridLayoutyes–
CardCardLayoutyes–
TabsTabsLayoutyeschange
HeadingHeadingContent––
TextTextContent––
ImageImageContent––
ButtonButtonForm–click
TextInputText fieldForm–change, submit
SelectSelectForm–change
CheckboxCheckboxForm–change
DateInputDateForm–change
TableTableData–rowClick
ListListDatayesclick
ChartChartData––

Every component has two properties:

PropertyMeaning
visibleExpression 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.
classNamecustom CSS classes, separated by spaces. In the builder, the field is called “CSS class”.

Stack – Stack

PropertyIn the builderMeaning
gapGap (px)Gap between the elements in pixels. New in the builder: 12.
directionDirectionWhether the elements are stacked vertically or side by side. Values: column (Vertical), row (Side by side).
labelTab title (in Tabs)Label shown next to or above the element.
aligncode onlyAlignment across the direction: start, center, end or stretch.
justifycode onlyDistribution 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

PropertyIn the builderMeaning
columnsColumnsHow many columns sit side by side. New in the builder: 2.
minWidthMinimum width per column (px)No column gets narrower; below that, the grid wraps.
gapGap (px)Gap between the elements in pixels. New in the builder: 12.
labelTab 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

PropertyIn the builderMeaning
titleTitleHeading of the card. New in the builder: "Karte".
labelTab title (in Tabs)Label shown next to or above the element.

A card needs label only as a child of Tabs.

Tabs – Tabs

PropertyIn the builderMeaning
defaultTabcode onlyIndex 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

PropertyIn the builderMeaning
textTextDisplayed text. {{…}} inserts values from the state. New in the builder: "Überschrift".
levelLevelSize of the heading, H1 is the largest. Values: 1 (H1), 2 (H2), 3 (H3), 4 (H4). New in the builder: 2.

Text – Text

PropertyIn the builderMeaning
textTextUse {{state.key}} to insert values. New in the builder: "Text".
sizeSizeFont size of the text. Values: sm (Small), md (Normal), lg (Large).
mutedMutedGrey, subdued text for secondary information.
aligncode onlyAlignment: left, center or right.

Image – Image

PropertyIn the builderMeaning
srcImage URL (https)Address of the image, must start with https.
altAlternative textDescription for screen readers and for when the image does not load.
widthWidth (px)Width in pixels, empty for full width.
radiusCorners (px)Corner rounding in pixels.

Only addresses with https: or data:image/ are loaded.

Button – Button

PropertyIn the builderMeaning
labelLabelLabel shown next to or above the element. New in the builder: "Button".
variantVariantAppearance of the button. Values: filled (Filled), light (Light), outline (Outline), subtle (Subtle).
fullWidthFull widthTakes up the entire available width.
disabledDisabledLocks the element so it cannot be used.
colorcode onlyred 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

PropertyIn the builderMeaning
labelLabelLabel shown next to or above the element. New in the builder: "Textfeld".
modelState keyThe entered value ends up in this state key.
placeholderPlaceholderGrey hint in the empty field, e.g. an example.
typeTypeKind of input, controls keyboard and validation. Values: text (Text), email (Email), number (Number), search (Search).
requiredRequiredThe field must be filled in.
valuecode onlyInitial value if no model is set.
disabledcode onlyLocks 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

PropertyIn the builderMeaning
labelLabelLabel shown next to or above the element. New in the builder: "Auswahl".
modelState keyThe entered value ends up in this state key.
optionsOptionsList such as ["A", "B"] or [{"value": "a", "label": "A"}], or {{state.liste}}. New in the builder: ["Option 1","Option 2"].
optionValueField for the valueField of each row that is stored on selection.
optionLabelField for the textField of each row that is shown in the selection.
placeholderPlaceholderGrey hint in the empty field, e.g. an example.
valuecode onlyInitial value if no model is set.
disabledcode onlyLocks 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

PropertyIn the builderMeaning
labelLabelLabel shown next to or above the element. New in the builder: "Checkbox".
modelState keyThe entered value ends up in this state key.
valuecode onlyInitial value if no model is set.
disabledcode onlyLocks the checkbox.

true or false ends up in the state; change delivers { value }.

DateInput – Date

PropertyIn the builderMeaning
labelLabelLabel shown next to or above the element. New in the builder: "Datum".
modelState keyThe entered value ends up in this state key.
withTimeWith timeAlso ask for the time.
placeholdercode onlyGrey hint in the empty field.
requiredcode onlyThe field must be filled in.
disabledcode onlyLocks the field.
valuecode onlyInitial 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

PropertyIn the builderMeaning
dataData source (expression)List from the state that the table shows.
columnsColumns (JSON)e.g. [{"key": "name", "label": "Name"}]. Empty = all fields.
emptyText without entriesShown 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

PropertyIn the builderMeaning
dataData source (expression)List from the state whose entries the list shows.
itemTextText per entry (expression)Applies only without child elements. {{item.feld}} accesses the entry.
emptyText without entriesShown 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

PropertyIn the builderMeaning
dataData source (expression)List from the state that the chart shows.
xField for labelField name of each row for the label.
yField for valueField name of each row for the numeric value.
kindKindHow the chart is drawn. Values: bar (Bar), line (Line). New in the builder: "bar".
heightHeight (px)Height in pixels.
colorcode onlyColour of the bars or the line. Default: var(--mc-color-primary).
titlecode onlyDescription 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:

NameContent
statethe app's entire state
state.$loadingtrue per state key of a binding while it is loading, e.g. {{state.$loading.termine}}
contextfrom the host: organisation (id, name), user (id, firstName), theme (light/dark), locale (de/en), target (dashboard/mobile)
item, indexin children of a List and in actions of rowClick or of a list's click
eventin 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" }
]
FieldRequiredMeaning
sourceyesName of the data source, e.g. me.profile
paramsnoParameters of the source; values may contain {{…}}
toyesState key that receives the result. Dots separate levels: daten.termine. Must start with a letter, _ or $.
picknoPath 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

EventIn the builderComponentsevent
loadOn loadStack–
clickOn clickButton, Listfor List the clicked entry, otherwise –
changeOn changeTextInput, Select, Checkbox, DateInput, Tabs{ value }, for Tabs the index
submitOn submit (Enter)TextInput{ value }
rowClickOn row clickTablethe 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

ActionIn the builderPurpose
callFetch datacall a data source, optionally store the result in the state
exportExportdownload or share a list as CSV, XLSX or PDF
navigateNavigatesend the host to one of its pages
setStateSet stateset a state key
toastShow noticeshow a notice in the host
scriptScript 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}}" } }
FieldRequiredMeaning
sourceyesData source
paramsnoParameters, with expressions
tonoState key for the result; without to, the result is discarded
picknoPath 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 }
FieldRequiredMeaning
formatyescsv, xlsx or pdf
datayesExpression that yields a list
filenameyesFile name; the runtime adds the extension
columnsnoColumns with key and optional label; if omitted, all fields of the first row
excelnoCSV only: semicolon and BOM for German Excel (default)
titlenoPDF only: heading above the table

The file goes via the bridge to the host, which downloads it (dashboard) or shares it (phone).

{ "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:

MessageCause
schemaVersion must be 1wrong 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.labela 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.