<h2 id="calculatedefaultexittransition-role">calculateDefaultExitTransition</h2>

<div class='sourceset sourceset-common'>Common</div>

```kotlin
@ExperimentalMaterial3AdaptiveApi
fun <Role : PaneScaffoldRole> PaneScaffoldMotionDataProvider<Role>.calculateDefaultExitTransition(
    role: Role
) =
    when (this[role].motion) {
        PaneMotion.ExitToLeft ->
            slideOutHorizontally(PaneMotionDefaults.OffsetAnimationSpec) { slideOutToLeftOffset }
        PaneMotion.ExitToRight ->
            slideOutHorizontally(PaneMotionDefaults.OffsetAnimationSpec) { slideOutToRightOffset }
        PaneMotion.ExitWithShrink -> {
            shrinkHorizontally(PaneMotionDefaults.SizeAnimationSpec, Alignment.CenterHorizontally) +
                slideOutHorizontally(PaneMotionDefaults.OffsetAnimationSpec) {
                    getHidingPaneTargetLeft(role) - this[role].currentLeft
                }
        }
        PaneMotion.ExitAsModal -> {
            fadeOut(animationSpec = PaneMotionDefaults.VisibilityAnimationSpec)
        }
        else -> ExitTransition.None
    }
```

Calculates the default [ExitTransition](/jetpack-compose/androidx.compose.animation/animation/classes/ExitTransition) of the pane associated to the given role when it's
hiding. The [PaneMotion](/jetpack-compose/androidx.compose.material3.adaptive/adaptive-layout/interfaces/PaneMotion) and pane measurement data provided by [PaneScaffoldMotionDataProvider](/jetpack-compose/androidx.compose.material3.adaptive/adaptive-layout/interfaces/PaneScaffoldMotionDataProvider)
will be used to decide the transition type and relevant values like sliding offsets.

#### Parameters

| | |
| --- | --- |
| role | the role of the pane that is supposed to perform the [ExitTransition](/jetpack-compose/androidx.compose.animation/animation/classes/ExitTransition) when hiding. |