<h2 id="rememberexpandablestatemapping-initiallyexpanded-expandanimationspec-collapseanimationspec">rememberExpandableStateMapping</h2>

<div class='sourceset sourceset-android'>Android</div>

```kotlin
@Composable
@ExperimentalWearFoundationApi
public fun <T> rememberExpandableStateMapping(
    initiallyExpanded: (key: T) -> Boolean = { false },
    expandAnimationSpec: AnimationSpec<Float> = ExpandableItemsDefaults.expandAnimationSpec,
    collapseAnimationSpec: AnimationSpec<Float> = ExpandableItemsDefaults.collapseAnimationSpec,
): ExpandableStateMapping<T>
```

Create and [remember](/jetpack-compose/androidx.compose.runtime/runtime/composable-functions/remember) a mapping from keys to [ExpandableState](/jetpack-compose/androidx.wear.compose/compose-foundation/classes/ExpandableState)s [ExpandableState](/jetpack-compose/androidx.wear.compose/compose-foundation/classes/ExpandableState)s can be
requested by key, and we will created with the parameters given here when a mapping didn't exist
before. This is mainly useful when you want to have a variable number of expandables, that can
change at runtime (for example, elements on a ScalingLazyColumn)

#### Parameters

| | |
| --- | --- |
| initiallyExpanded | A function to compute the initial state given the key. |
| expandAnimationSpec | The [AnimationSpec](/jetpack-compose/androidx.compose.animation/animation-core/interfaces/AnimationSpec) to use when showing the extra information. |
| collapseAnimationSpec | The [AnimationSpec](/jetpack-compose/androidx.compose.animation/animation-core/interfaces/AnimationSpec) to use when hiding the extra information. |