# ExpandableState

Artifact: [androidx.wear.compose:compose-foundation](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/foundation/Expandable.kt+class:androidx.wear.compose.foundation.ExpandableState) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.2.0)


```
class ExpandableState
```

<br />

*** ** * ** ***

State of the Expandable composables.

It's used to control the showing/hiding of extra information either directly or connecting it with something like a button.

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/saveable/Saver<https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html>` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState#saver(androidx.compose.animation.core.AnimationSpec,androidx.compose.animation.core.AnimationSpec)( expandAnimationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>, collapseAnimationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> )` The default `https://developer.android.com/reference/kotlin/androidx/compose/runtime/saveable/Saver` implementation for `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState`. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState#expandProgress()` While in the middle of the animation, this represents the progress from 0f (collapsed) to 1f (expanded), or the other way around. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState#expanded()` Represents the current state of the component, true means it's showing the extra information. |

## Public companion functions

### saver

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.4.0)

```
@Composable
fun saver(
    expandAnimationSpec: AnimationSpec<Float>,
    collapseAnimationSpec: AnimationSpec<Float>
): Saver<ExpandableState, Boolean>
```

The default `https://developer.android.com/reference/kotlin/androidx/compose/runtime/saveable/Saver` implementation for `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState`.

## Public properties

### expandProgress

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.2.0)

```
val expandProgress: Float
```

While in the middle of the animation, this represents the progress from 0f (collapsed) to 1f (expanded), or the other way around. If no animation is running, it's either 0f if the extra content is not showing, or 1f if the extra content is showing.

### expanded

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.2.0)

```
var expanded: Boolean
```

Represents the current state of the component, true means it's showing the extra information. If it's in the middle of an animation, the value of this field takes into account only the target of that animation.

Modifying this value triggers a change to show/hide the extra information.