Stay organized with collections
Save and categorize content based on your preferences.
Navigation with Fragments support destinations written as Fragments. This artifacts builds upon that base to allow you to add destinations written purely in Compose to your navigation graph without rewriting your entire navigation structure.
It does this by wrapping each destination written in Compose in its own Fragment instance, using reflection to call your @Composable
function.
Classes
Top-level properties summary
Top-level properties
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-05-15 UTC.
[null,null,["Last updated 2025-05-15 UTC."],[],[],null,["# androidx.navigation.fragment.compose\n====================================\n\nNavigation with Fragments support destinations written as Fragments. This artifacts builds upon that base to allow you to add destinations written purely in Compose to your navigation graph without rewriting your entire navigation structure.\n\nIt does this by wrapping each destination written in Compose in its own Fragment instance, using reflection to call your `@Composable` function.\n\nClasses\n-------\n\n|-------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ComposableFragment](/reference/kotlin/androidx/navigation/fragment/compose/ComposableFragment) | This class provides a [Fragment](/reference/kotlin/androidx/fragment/app/Fragment) wrapper around a composable function that is loaded via reflection. |\n| [ComposableFragmentNavigator](/reference/kotlin/androidx/navigation/fragment/compose/ComposableFragmentNavigator) | This Navigator intercepts the inflation of `navigation` destinations in a Navigation with Fragment XML file, reusing the `android:name` field as the fully qualified name of the composable function to use as the contents of the inflated destination. |\n| [ComposableNavHostFragment](/reference/kotlin/androidx/navigation/fragment/compose/ComposableNavHostFragment) | A [NavHostFragment](/reference/kotlin/androidx/navigation/fragment/NavHostFragment) that adds support for [ComposableFragment](/reference/kotlin/androidx/navigation/fragment/compose/ComposableFragment) instances via [ComposableFragmentNavigator](/reference/kotlin/androidx/navigation/fragment/compose/ComposableFragmentNavigator). |\n\nTop-level properties summary\n----------------------------\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ProvidableCompositionLocal](/reference/kotlin/androidx/compose/runtime/ProvidableCompositionLocal)`\u003c`[Fragment](/reference/kotlin/androidx/fragment/app/Fragment)`\u003e` | [LocalFragment](/reference/kotlin/androidx/navigation/fragment/compose/package-summary#LocalFragment()) The CompositionLocal containing the containing [Fragment](/reference/kotlin/androidx/fragment/app/Fragment). |\n\nTop-level properties\n--------------------\n\n### LocalFragment\n\nArtifact: [androidx.navigation:navigation-fragment-compose](/jetpack/androidx/releases/navigation) \n[View Source](https://cs.android.com/search?q=file:androidx/navigation/fragment/compose/LocalFragment.kt+symbol:LocalFragment) \nAdded in [2.8.0](/jetpack/androidx/releases/navigation#2.8.0) \n\n```\nval LocalFragment: ProvidableCompositionLocal\u003cFragment\u003e\n```\n\nThe CompositionLocal containing the containing [Fragment](/reference/kotlin/androidx/fragment/app/Fragment). This is sett by default for composables created within a [ComposableFragment](/reference/kotlin/androidx/navigation/fragment/compose/ComposableFragment)."]]