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

```kotlin
public interface SharedContentConfig
```

[SharedContentConfig](/jetpack-compose/androidx.compose.animation/animation/interfaces/SharedTransitionScope.SharedContentConfig) allows a shared element to be disabled or enabled dynamically through
[isEnabled](/jetpack-compose/androidx.compose.ui/ui-test/functions/isEnabled) property. By default, `shouldKeepEnabledForOngoingAnimation` is true. This means
if the shared element transition is already running for the layout that this
[SharedContentConfig](/jetpack-compose/androidx.compose.animation/animation/interfaces/SharedTransitionScope.SharedContentConfig) is applied to, we will keep the shared element enabled until the
animation is finished. In other words, disabling shared element while the animation is
in-flight will have no effect, unless `shouldKeepEnabledForOngoingAnimation` is overridden.

[alternativeTargetBoundsInTransitionScopeAfterRemoval](#alternativetargetboundsintransitionscopeafterremoval) defines an alternative target bounds
for when the target shared element is disposed amid animation (e.g., scrolled out of the
viewport and subsequently disposed). By default, no alternative target bounds is defined - As
soon as the target shared element (i.e. the shared element in the incoming/target content) is
removed, the shared element transition for the shared elements with the same key will be
cancelled.

## Functions

<h2 id="alternativetargetboundsintransitionscopeafterremoval-targetboundsbeforeremoval-sharedtransitionlayoutsize">alternativeTargetBoundsInTransitionScopeAfterRemoval</h2>

```kotlin
public fun SharedContentState.alternativeTargetBoundsInTransitionScopeAfterRemoval(
            targetBoundsBeforeRemoval: Rect,
            sharedTransitionLayoutSize: Size,
        ): Rect?
```

[alternativeTargetBoundsInTransitionScopeAfterRemoval](#alternativetargetboundsintransitionscopeafterremoval) returns an alternative target
bounds for when the target shared element is disposed amid animation (e.g., scrolled out
of the viewport and subsequently disposed).

By default, no alternative target bounds is defined - As soon as the target shared
element (i.e. the shared element in the incoming/target content) is removed, the shared
element transition for the shared elements with the same key will be cancelled.

#### Parameters

| | |
| --- | --- |
| targetBoundsBeforeRemoval | The target bounds of the shared element **relative to the SharedTransitionLayout** before it is removed. |
| sharedTransitionLayoutSize | The size of the shared transition layout for convenient calculation. |