StylishSwipeToDismissBox

fun StylishSwipeToDismissBox(state: SwipeToDismissBoxState, backgroundContent: @Composable RowScope.() -> Unit, modifier: Modifier = Modifier, enableDismissFromStartToEnd: Boolean = true, enableDismissFromEndToStart: Boolean = true, gesturesEnabled: Boolean = true, onDismiss: (SwipeToDismissBoxValue) -> Unit = {}, content: @Composable RowScope.() -> Unit)

A swipe-to-dismiss container that reveals backgroundContent as the user swipes content to either side, then settles or dismisses based on the swipe distance.

This is the Finish-layer wrapper around the Material 3 SwipeToDismissBox: it forwards every parameter unchanged and keeps the M3 signature, so callers can use the familiar backgroundContent / content slot contract without touching experimental or deprecated M3 overloads. The component is intentionally unstyled — the surface, shape, and colors of both the background and the foreground content are owned by the caller, matching Material's guidance that swipe-to-dismiss backgrounds are item-specific (e.g. a red destructive background). Use it together with rememberStylishSwipeToDismissBoxState.

Parameters

state

The SwipeToDismissBoxState driving this container. Create it with rememberStylishSwipeToDismissBoxState.

backgroundContent

A composable rendered behind content, revealed as the content is swiped away. Receives RowScope.

modifier

Modifier applied to the container Box root.

enableDismissFromStartToEnd

Whether swiping from start to end can dismiss. Defaults to true.

enableDismissFromEndToStart

Whether swiping from end to start can dismiss. Defaults to true.

gesturesEnabled

Whether pointer gestures are active. When false, the content cannot be swiped (e.g. while another gesture is in progress). Defaults to true.

onDismiss

Called when the content settles into a dismissed state, receiving the dismissed direction. Defaults to no-op.

content

The foreground content that can be swiped. Receives RowScope.

See also