NavigableCircuitContent
A composable that provides the core navigation and state management for Circuit-based navigation systems. It manages the rendering of screens from a navstack, handles navigation transitions, and coordinates result passing between screens when navigating backward. This is the primary entry point for creating navigable content surfaces in Circuit.
This function automatically wraps your navigator with result handling capabilities via rememberAnsweringResultNavigator, enabling screens to pass results back when using rememberAnsweringNavigator.
Features
State Management: Manages saveable and retained state for each screen in the navstack with automatic preservation across configuration changes
Navigation Transitions: Handles animated transitions between screens using NavDecoration or custom AnimatedNavDecorator
Result Handling: Automatically manages screen results when using rememberAnsweringNavigator to pass data back from child screens
Usage
setContent {
val navStack = rememberSaveableNavStack(root = HomeScreen)
val navigator = rememberCircuitNavigator(navStack)
NavigableCircuitContent(navigator, navStack)
}State Management
This creates an isolated retained state registry for the navigation graph to ensure proper state preservation across configuration changes when using rememberRetained. This prevents state loss for off-screen navstack records, even when they're not actively composed. See the implementation comments for technical details.
Parameters
The Navigator used to handle navigation events. Typically created via rememberCircuitNavigator.
The NavStack containing the stack of Records to display. Must have at least one record. Typically created via rememberSaveableNavStack.
The Modifier to apply to the content.
The Circuit instance providing UI factories and configuration. Defaults to LocalCircuit.
Optional map of ProvidedValues to make available to specific records in the navstack. These values will be provided via composition locals when the corresponding record is displayed.
The NavDecoration used to decorate navigation transitions. Defaults to the circuit's default decoration.
Optional AnimatedNavDecorator.Factory to create custom animated transitions. If provided, takes precedence over decoration.
A composable function invoked when a screen cannot be rendered (e.g., no UI factory available). Defaults to the circuit's Circuit.onUnavailableContent.
See also
for requesting results from child screens
for the underlying result navigator creation
for creating a navstack
for creating a navigator
A legacy variant of NavigableCircuitContent that takes a Navigator and a BackStack.
See also
for the standard overload that takes a Navigator and NavStack.
An experimental variant of NavigableCircuitContent that takes an AnsweringResultNavigator directly, which combines navigation and result handling into a single object.
This variant is useful when you need direct access to the AnsweringResultNavigator instance, such as when passing the navigator to nested components, managing multiple navigation graphs with shared result handling, or when you need custom control over the result handler lifecycle.
For most use cases, prefer the standard NavigableCircuitContent overload that takes a Navigator and NavStack, as it automatically creates and manages the result navigator.
Usage
setContent {
val navStack = rememberSaveableNavStack(root = HomeScreen)
val baseNavigator = rememberCircuitNavigator(navStack)
val navigator = rememberAnsweringResultNavigator(baseNavigator, navStack)
NavigableCircuitContent(navigator)
}Parameters
The AnsweringResultNavigator that handles both navigation and results.
The Modifier to apply to the content.
The Circuit instance providing UI factories and configuration.
Optional map of ProvidedValues to make available to specific records.
The NavDecoration used to decorate navigation transitions.
Optional AnimatedNavDecorator.Factory to create custom animated transitions.
A composable function invoked when a screen cannot be rendered.
See also
for the navigator that combines navigation and result handling
for creating an answering result navigator