currentState by remember { mutableStateOf(BoxState.Collapsed) } val transition = updateTransition(currentState) val offset by transition.animateDp(label = "") { state -> when (state) { BoxState.Collapsed -> 100.dp BoxState.Expanded -> 50.dp } } val borderWidth by transition.animateDp(label = "") { state -> when (state) { BoxState.Collapsed -> 1.dp BoxState.Expanded -> 0.dp } }