Skip to main content

Navigation Overview

A Navigation directive is a server instruction telling the client how to update its screen stack. The server includes it in a Session response whenever it wants the client to transition to a new state.

Navigation is optional — its absence means the current screen stays active. The server sends at most one navigation directive per response.

When navigation appears

Navigation directives can appear in responses from both endpoints:

Field reference

FieldTypePresent whenDescription
idstringalwaysIdentifier for this directive. The client uses it to match a server response to a pending optimistic navigation for confirmation or rollback. See Optimistic Navigation.
modeenumalwaysThe stack operation to perform. See Stack Modes.
screenstringPUSH, REPLACE, RESETThe target screen name.
flow{ name, behavior }PUSH, REPLACE, RESETThe logical flow context for this navigation. See Flows.
transitionenumoptionalPage animation for this transition. Overrides the client's default. See Transitions.
screenParamsobjectscreen-dependentTyped parameters for the target screen. Required when the target screen mandates params.

Why screenParams are in the navigation directive

The server may navigate the client to a screen it did not explicitly request — for example, an action that resolves to a different destination based on server-side state. Since the client may not have prepared params for this destination, the server includes them in the directive. Params also enable the client to refresh the screen later without losing context.

Mode constraints

POP and FAILED carry only the id and mode fields. They do not carry screen, flow, or transition:

ModesHas screen / flow / transition?Why
PUSH, REPLACE, RESETYesThe client needs to know where to navigate and which flow context to apply
POPNoThe destination is the previous screen — the client already knows it
FAILEDNoThere is no destination. The client restores the stack to its pre-action state.