NavigationEventInfo


Known direct subclasses
NavBackStackEntryInfo

Snapshot of a back stack entry in a androidx.navigation.NavController.

NavigationEventInfo.None

A default used when no specific information is associated with a navigation event.

SceneInfo

Represents a snapshot of the visible destinations in a navigation container.


Provides contextual information about a navigation state (e.g., a screen or route).

Implement this interface on objects that represent a specific state in your UI. A typical implementation should be a data holder (such as a data class) that defines meaningful structural equality (equals/hashCode). This ensures that navigation state comparisons, state flows, and recompositions work as expected. Failing to provide proper equality can lead to unnecessary recompositions or infinite update loops.

Guidelines for implementors:

  • Prefer data class to automatically provide equality and toString.

  • Keep instances immutable for predictable behavior in state flows.

  • Ensure equality reflects the logical identity of the navigation state.

This allows you to associate custom, comparable data with a system navigation event emissions.

Summary

Nested types

A default used when no specific information is associated with a navigation event.

Public constructors

Cmn

Public properties

open String?

Defines the title of the navigation destination.

Cmn
open String?

Defines the URL or path representation of the navigation destination.

Cmn

Public constructors

NavigationEventInfo()

Public properties

title

@ExperimentalNavigationEventApi
open val titleString?

Defines the title of the navigation destination.

Host environments can use this value to represent the active destination (e.g., a web browser's tab title).

Follow these best practices:

  • Localization: Localize or translate the value.

  • Resolution: Resolve resource IDs to strings before returning.

  • Formatting: Interpolate dynamic parameters directly (e.g., "Details - $id").

Defaults to null, meaning the title remains unchanged.

url

@ExperimentalNavigationEventApi
open val urlString?

Defines the URL or path representation of the navigation destination.

Host environments can use this value to update their location display (e.g., a web browser's address bar).

For web environments, this supports:

  • Full URL (e.g., "https://example.com/home"): must match the active origin.

  • Relative path (e.g., "/home"): appends to the active origin.

  • Hash fragment (e.g., "#home"): triggers a hash navigation.

Defaults to null, meaning the location remains unchanged.