rememberExpandableState

Composable Function

Android
@Composable
public fun rememberExpandableState(
    initiallyExpanded: Boolean = false,
    expandAnimationSpec: AnimationSpec<Float> = ExpandableItemsDefaults.expandAnimationSpec,
    collapseAnimationSpec: AnimationSpec<Float> = ExpandableItemsDefaults.collapseAnimationSpec,
): ExpandableState

Create and remember an ExpandableState

Example of an expandable list:

Example of an expandable text:

Parameters

initiallyExpandedThe initial value of the state.
expandAnimationSpecThe AnimationSpec to use when showing the extra information.
collapseAnimationSpecThe AnimationSpec to use when hiding the extra information.