Swipe Button
This component features smooth animations, state management, and transitions between idle and completed states (where the button collapses into a circular progress indicator).
Parameters
The Modifier to be applied to the root layout.
The state object SwipeButtonState to control and observe the button's progress.
Whether the button is interactive. If false, drag gestures are disabled.
Whether the background content should translate horizontally as the user swipes.
The initial corner radius of the button container.
Controls how quickly the background content fades out during the swipe.
Animation spec for the width transition when reaching the completed state.
Animation spec for the corner radius transition.
Animation spec for the "spring back" effect when a swipe is released before the threshold.
Animation spec for the final progress movement to 100%.
Animation spec for resetting the button state.
Composable for the button's background layer.
Composable for the main text or instruction, providing the current swipe progress (0f-1f).
Composable for the draggable handle, providing the current swipe progress.
Composable displayed when the button is in the SwipeButtonState.isCompleted state.