Skip to content

Screens and components

A screen is one JSON file: a tree of components with a Screen at the root.

{
"schemaVersion": "1.0.0",
"id": "home",
"root": {
"id": "home-root",
"type": "Screen",
"props": { "title": "Home", "safeArea": true, "scroll": true },
"preset": "page",
"children": [
{ "id": "welcome", "type": "Text", "props": { "text": "Welcome" }, "preset": "heading" },
{ "id": "intro-card", "type": "Card", "props": {}, "preset": "panel", "children": [
{ "id": "intro", "type": "Text", "props": { "text": "Everything you need today." } }
] }
]
}
}
  • Containers (Screen, Stack, Row, Grid, Card, Form) must have children.
  • RecordList has exactly one child: the template drawn for each row.
  • Everything else has no children.

A Screen lays its children out top to bottom, like a Stack. Use Row for side by side and Grid for one or two columns.

Give a component a preset to reuse a named look from your theme, and a style for one-off changes. Style values refer to theme tokens:

{ "id": "total", "type": "Text", "props": { "text": "42" },
"preset": "heading", "style": { "color": "$color.primary", "textAlign": "center" } }

All the options are in Style options. There is no free-form color, size or position.

Inside a RecordList or a Form, a Text, Badge or input can show a field with bindings.value:

{ "id": "topic-name", "type": "Text", "props": {}, "bindings": { "value": { "model": "topic", "field": "name" } } }

Values are always shown as plain text. See Models and operations.

Only two things act: a Button (on tap) and a Form (on save). A button either navigates or runs an operation:

{ "id": "open-about", "type": "Button", "props": { "label": "About" },
"action": { "type": "navigate", "routeId": "about", "parameters": {} } }

Up to 50 screens, 2,000 components in total, and components nested at most 12 deep. See Limits.