← Back to Material 3 Compose
SwipeToDismiss
Component
in
Material 3
. Since 1.1.0Overview
Code Examples
A composable that can be dismissed by swiping left or right.
Overloads
SwipeToDismiss
@Composable
@ExperimentalMaterial3Api
fun SwipeToDismiss(
state: DismissState,
background: @Composable RowScope.() -> Unit,
dismissContent: @Composable RowScope.() -> Unit,
modifier: Modifier = Modifier,
directions: Set<DismissDirection> = setOf(EndToStart, StartToEnd),
)
Parameters
Name | Description |
---|---|
state | The state of this component. |
background | A composable that is stacked behind the content and is exposed when the content is swiped. You can/should use the state to have different backgrounds on each side. |
dismissContent | The content that can be dismissed. |
modifier | Optional Modifier for this component. |
directions | The set of directions in which the component can be dismissed |