# androidx.navigation.fragment.compose

# androidx.navigation.fragment.compose

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

|------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ComposableFragment](https://developer.android.com/reference/kotlin/androidx/navigation/fragment/compose/ComposableFragment)                   | This class provides a[Fragment](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment)wrapper around a composable function that is loaded via reflection.                                                                                                                                                                                                                                            |
| [ComposableFragmentNavigator](https://developer.android.com/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.                                                                                                                                                                         |
| [ComposableNavHostFragment](https://developer.android.com/reference/kotlin/androidx/navigation/fragment/compose/ComposableNavHostFragment)     | A[NavHostFragment](https://developer.android.com/reference/kotlin/androidx/navigation/fragment/NavHostFragment)that adds support for[ComposableFragment](https://developer.android.com/reference/kotlin/androidx/navigation/fragment/compose/ComposableFragment)instances via[ComposableFragmentNavigator](https://developer.android.com/reference/kotlin/androidx/navigation/fragment/compose/ComposableFragmentNavigator). |

## Top-level properties summary

|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ProvidableCompositionLocal](https://developer.android.com/reference/kotlin/androidx/compose/runtime/ProvidableCompositionLocal)`<`[Fragment](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment)`>` | [LocalFragment](https://developer.android.com/reference/kotlin/androidx/navigation/fragment/compose/package-summary#LocalFragment()) The CompositionLocal containing the containing[Fragment](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment). |

## Top-level properties

### LocalFragment

Artifact:[androidx.navigation:navigation-fragment-compose](https://developer.android.com/jetpack/androidx/releases/navigation)  
[View Source](https://cs.android.com/search?q=file:androidx/navigation/fragment/compose/LocalFragment.kt+symbol:LocalFragment)  
Added in[2.8.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.8.0)  

```
val LocalFragment: ProvidableCompositionLocal<Fragment>
```

The CompositionLocal containing the containing[Fragment](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment). This is sett by default for composables created within a[ComposableFragment](https://developer.android.com/reference/kotlin/androidx/navigation/fragment/compose/ComposableFragment).