NavigationState

@Serializable
data class NavigationState(val currentEntry: NavigationEntry, val backStack: List<NavigationEntry>, val lastNavigationAction: NavigationAction? = null, val screenRetentionDuration: Duration, val visibleLayers: List<NavigationEntry>, val currentFullPath: String, val currentGraphHierarchy: List<String>, val breadcrumbs: List<NavigationBreadcrumb>, val isCurrentModal: Boolean, val isCurrentScreen: Boolean, val hasModalsInStack: Boolean, val contentLayerEntries: List<NavigationEntry>, val globalOverlayEntries: List<NavigationEntry>, val systemLayerEntries: List<NavigationEntry>, val underlyingScreen: NavigationEntry?, val modalsInStack: List<NavigationEntry>, val underlyingScreenGraphHierarchy: List<String>? = null, val activeModalContexts: Map<String, ModalContext>, val pendingNavigation: PendingNavigation? = null, val isBootstrapping: Boolean = true, val isEvaluatingNavigation: Boolean = false, val currentTitle: String? = null) : ModuleState(source)

Immutable snapshot of the navigation system's runtime state.

All derived/computed properties (layer lists, flags, hierarchy) are pre-computed by the reducer so that reads in the Compose tree are allocation-free.

Example — check current location in Compose:

val navState by selectState<NavigationState>().collectAsState()
if (navState.isInGraph("auth")) { ... }
if (navState.isAtPath("home/dashboard")) { ... }

Constructors

Link copied to clipboard
constructor(currentEntry: NavigationEntry, backStack: List<NavigationEntry>, lastNavigationAction: NavigationAction? = null, screenRetentionDuration: Duration, visibleLayers: List<NavigationEntry>, currentFullPath: String, currentGraphHierarchy: List<String>, breadcrumbs: List<NavigationBreadcrumb>, isCurrentModal: Boolean, isCurrentScreen: Boolean, hasModalsInStack: Boolean, contentLayerEntries: List<NavigationEntry>, globalOverlayEntries: List<NavigationEntry>, systemLayerEntries: List<NavigationEntry>, underlyingScreen: NavigationEntry?, modalsInStack: List<NavigationEntry>, underlyingScreenGraphHierarchy: List<String>? = null, activeModalContexts: Map<String, ModalContext>, pendingNavigation: PendingNavigation? = null, isBootstrapping: Boolean = true, isEvaluatingNavigation: Boolean = false, currentTitle: String? = null)

Properties

Link copied to clipboard

Active modal contexts keyed by the modal entry's full path.

Link copied to clipboard

Ordered back stack; the last element is always equal to currentEntry.

Link copied to clipboard

Breadcrumb trail derived from currentFullPath, suitable for navigation UIs.

Link copied to clipboard

true when there is more than one entry in backStack and a back navigation is possible.

Link copied to clipboard
Link copied to clipboard

The entry that is currently active (top of stack).

Link copied to clipboard

The full slash-separated path for currentEntry, e.g. "auth/login".

Link copied to clipboard

Ordered list of graph IDs from root to the graph containing currentEntry.

Link copied to clipboard

Path segments of currentFullPath with empty segments filtered out.

Link copied to clipboard
val currentTitle: String? = null

Resolved title string for currentEntry, populated by NavigationRender after invoking the navigatable's titleResource inside the Compose tree.

Link copied to clipboard

Number of entries currently in backStack.

Link copied to clipboard

Layer entries grouped by their RenderLayer.

Link copied to clipboard
Link copied to clipboard

true when at least one modal is present anywhere in backStack.

Link copied to clipboard

true until bootstrap (and any cold-start deep link) has fully resolved. NavigationRender suppresses content layers while this is true to avoid flashing the initial placeholder before the real destination is known.

Link copied to clipboard

true when currentEntry resolves to a Modal.

Link copied to clipboard

true when currentEntry resolves to a Screen.

Link copied to clipboard

true while a guard or entry-definition lambda is being evaluated and the evaluation has exceeded its loading threshold. NavigationRender renders the io.github.syrou.reaktiv.navigation.definition.LoadingModal directly as a boolean-controlled overlay rather than a backstack entry while this is true.

Link copied to clipboard

The most recent action dispatched by the navigation system, used for content preservation.

Link copied to clipboard

All modal entries currently present in backStack.

Link copied to clipboard

Number of segments in currentFullPath.

Link copied to clipboard
Link copied to clipboard

Navigation that was stored when a guard returned GuardResult.PendAndRedirectTo. Resume it after the guard condition is met via navigation { clearBackStack(); resumePendingNavigation() }.

Link copied to clipboard

Alias for visibleLayers — entries that should be rendered.

Link copied to clipboard

How long rendered screen content is retained in memory after being popped from the stack.

Link copied to clipboard

Entries assigned to RenderLayer.SYSTEM (e.g. loading modals).

Link copied to clipboard

The screen rendered underneath the current modal, or null if not in a modal.

Link copied to clipboard

Graph hierarchy of underlyingScreen, used so that isInGraph works correctly when isCurrentModal is true.

Link copied to clipboard

Entries that should be rendered, ordered from bottom to top layer.

Functions

Link copied to clipboard
fun isAtPath(path: String): Boolean

Returns true if any visible layer's route or path matches path.

Link copied to clipboard
fun isInGraph(graphId: String): Boolean

Returns true if the current navigation position is inside the given graphId.