Navigation
navigation.json lists every way to reach a screen.
{ "schemaVersion": "1.0.0", "initialRoute": "topics", "routes": [ { "id": "topics", "screenId": "topics", "label": "Topics", "parameters": {} }, { "id": "questions", "screenId": "questions", "label": "Questions", "parameters": { "topic-id": { "type": "string", "required": true, "minLength": 36, "maxLength": 36 } } } ]}- Every screen has exactly one route.
initialRouteis where the app opens. It cannot need parameters.- Going to a route pushes its screen with a back button, as on any iPhone app.
Passing a value to the next screen
Section titled “Passing a value to the next screen”A route can declare parameters: named, typed values the screen needs, such as which record to show. The button that navigates supplies them:
{ "id": "study", "type": "Button", "props": { "label": "Study this topic" }, "action": { "type": "navigate", "routeId": "questions", "parameters": { "topic-id": { "source": "field", "model": "topic", "field": "id" } } }}A parameter’s value comes from one of three sources:
| Source | Meaning |
|---|---|
{ "source": "literal", "value": 1 } |
A fixed value |
{ "source": "field", "model": "topic", "field": "id" } |
A field of the current row (inside a RecordList or Form) |
{ "source": "route", "parameter": "topic-id" } |
A parameter of the current screen’s own route |
On the next screen, an operation can use the route’s parameter, for example to list only that topic’s questions:
"bindings": { "items": { "operationId": "list-cards", "parameters": { "topic-id": { "source": "route", "parameter": "topic-id" } }, "pagination": { "offset": 0, "limit": 20 } } }Types are checked and never converted: the text "1" is not the number 1.
Tab bar
Section titled “Tab bar”For bottom tabs, add a tabBar. See Add a tab bar.