NavigationBackHandler

Functions summary

Unit
@Composable
NavigationBackHandler(
    state: NavigationEventState<NavigationEventInfo>,
    isBackEnabled: Boolean,
    onBackCancelled: () -> Unit,
    onBackCompleted: () -> Unit
)

A composable that handles only back navigation gestures, driven by a manually hoisted NavigationEventState.

Cmn

Functions

@Composable
fun NavigationBackHandler(
    state: NavigationEventState<NavigationEventInfo>,
    isBackEnabled: Boolean = true,
    onBackCancelled: () -> Unit = {},
    onBackCompleted: () -> Unit
): Unit

A composable that handles only back navigation gestures, driven by a manually hoisted NavigationEventState.

This is a convenience wrapper around the core NavigationEventHandler overload for cases where forward navigation is not relevant. Use this overload when hoisting state (e.g., for custom animations).

Refer to the primary NavigationEventHandler KDoc for details on precedence, unconditional usage, and timing considerations.

Parameters
state: NavigationEventState<NavigationEventInfo>

The hoisted NavigationEventState (returned from rememberNavigationEventState) to be registered.

isBackEnabled: Boolean = true

Controls whether back navigation gestures are handled.

onBackCancelled: () -> Unit = {}

Called if a back navigation gesture is cancelled.

onBackCompleted: () -> Unit

Called when a back navigation gesture completes and navigation occurs.