# BackNavigationBehavior

# BackNavigationBehavior

Artifact:[androidx.compose.material3.adaptive:adaptive-navigation](https://developer.android.com/jetpack/androidx/releases/compose-material3-adaptive)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/material3/adaptive/navigation/BackNavigationBehavior.kt+class:androidx.compose.material3.adaptive.navigation.BackNavigationBehavior)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material3-adaptive#1.0.0)
Common/AllAndroid/JVM
  - Cmn  

  ```
  @ExperimentalMaterial3AdaptiveApi
  value class BackNavigationBehavior
  ```

*** ** * ** ***

A class to control how back navigation should behave in a[ThreePaneScaffoldNavigator](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/navigation/ThreePaneScaffoldNavigator).

## Summary

|                                                        ### Public companion properties                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [BackNavigationBehavior](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior) | [PopLatest](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior#PopLatest()) Pop the latest destination from the backstack.                                                                                             | Cmn |
| [BackNavigationBehavior](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior) | [PopUntilContentChange](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior#PopUntilContentChange()) Pop destinations from the backstack until there is a content change.                                               | Cmn |
| [BackNavigationBehavior](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior) | [PopUntilCurrentDestinationChange](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior#PopUntilCurrentDestinationChange()) Pop destinations from the backstack until there is a change in the current destination pane. | Cmn |
| [BackNavigationBehavior](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior) | [PopUntilScaffoldValueChange](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior#PopUntilScaffoldValueChange()) Pop destinations from the backstack until there is a change in the scaffold value.                     | Cmn |

|                                   ### Public functions                                   |
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | [toString](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior#toString())`()` | Cmn |

## Public companion properties

### PopLatest

Cmn  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material3-adaptive#1.0.0)  

```
val PopLatest: BackNavigationBehavior
```

Pop the latest destination from the backstack.

Note: a multi-pane layout may create navigation backstacks that are not possible in a single-pane layout (e.g., navigating directly from one detail item to another). If the device size changes in the middle of the navigation, this[BackNavigationBehavior](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior)may result in unintuitive behavior.  

### PopUntilContentChange

Cmn  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material3-adaptive#1.0.0)  

```
val PopUntilContentChange: BackNavigationBehavior
```

Pop destinations from the backstack until there is a content change.

A "content change" is defined as either a change in the`contentKey`of the current[ThreePaneScaffoldDestinationItem](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldDestinationItem), or a change in the scaffold value (similar to[PopUntilScaffoldValueChange](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior#PopUntilScaffoldValueChange())).

Note: a multi-pane layout may create navigation backstacks that are not possible in a single-pane layout (e.g., navigating directly from one detail item to another). If the device size changes in the middle of the navigation, this[BackNavigationBehavior](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior)may result in unintuitive behavior.  

### PopUntilCurrentDestinationChange

Cmn  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material3-adaptive#1.0.0)  

```
val PopUntilCurrentDestinationChange: BackNavigationBehavior
```

Pop destinations from the backstack until there is a change in the current destination pane. In other words, back navigation forces a change in which pane is currently considered "active", as determined by the`pane`of the current[ThreePaneScaffoldDestinationItem](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldDestinationItem).  

### PopUntilScaffoldValueChange

Cmn  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material3-adaptive#1.0.0)  

```
val PopUntilScaffoldValueChange: BackNavigationBehavior
```

Pop destinations from the backstack until there is a change in the scaffold value. In other words, back navigation forces a change in which pane(s) is/are shown.

For example, in a single-pane layout, this will skip entries until the current destination is a different[ThreePaneScaffoldRole](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole). In a multi-pane layout, this will skip entries until the[PaneAdaptedValue](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/PaneAdaptedValue)of any pane changes.

## Public functions

### toString

Cmn  

```
open fun toString(): String
```