JengaSwipeToDismiss

fun JengaSwipeToDismiss(onDismiss: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, direction: JengaSwipeDirection = JengaSwipeDirection.EndToStart, icon: ImageVector = JengaTheme.icons.trash, actionContentDescription: String? = null, colors: JengaSwipeToDismissColors = JengaSwipeToDismissDefaults.colors(), background: @Composable () -> Unit? = null, content: @Composable () -> Unit)(source)

A row wrapper that reveals an action panel as it is swiped and triggers onDismiss once dragged past the threshold: the standard swipe-to-delete gesture. Generic and token-driven: by default it shows a destructive error panel with a icon glyph at the swiped end, but supply your own background slot for a different action.

The caller owns the list, so onDismiss should remove the item; the box does not keep the row hidden itself. Reversible removals should pair this with a snackbar Undo at the call site.

Parameters

onDismiss

called once the row is swiped past the dismiss threshold.

modifier

the Modifier for the whole row.

enabled

whether the swipe gesture is active.

direction

which way the row may be swiped.

icon

the default panel glyph (ignored when background is supplied).

actionContentDescription

accessibility label for the default action glyph.

colors

the reveal-panel colors; defaults to JengaSwipeToDismissDefaults.colors.

background

an optional custom reveal panel; fills the row behind content.

content

the row content shown at rest.