Snappy Swipe

A snappy swipe to delete component inspired by Material 3 Expressive notifications
https://github.com/user-attachments/assets/048bd432-1858-45ca-b781-19507885682b
Download
First add the dependency to your module's build.gradle:
implementation("io.github.klassenkonstantin:snappyswipe:<version>")
Example usage
val items = remember {
buildList {
repeat(10) { add("Item $it") }
}
}
val dragCoordinatorState = rememberSnappyDragCoordinatorState(
items = items,
key = { it },
)
LazyColumn(
verticalArrangement = Arrangement.spacedBy(dp),
) {
items(
items = items,
key = { it }
) { item ->
snappyDragState = rememberSnappyDragState(
onDismiss = {
}
)
SnappyItem(
key = item,
dragCoordinatorState = dragCoordinatorState,
snappyDragState = snappyDragState,
) {
ListItem(
colors = ListItemDefaults.colors(
containerColor = MaterialTheme.colorScheme.primaryContainer
),
modifier = Modifier
.padding(horizontal = dp)
.dragShape(),
headlineContent = {
Text(
text = item,
)
},
)
}
}
}