Icons
Iconsanimated
Delete
A trash can whose lid tilts open on hover, signalling a destructive action up front.
Installation
caveui components are copy-paste Jetpack Compose built entirely on Material 3 — there's no caveui dependency to add. Make sure Material 3 is on your classpath (it ships with the Compose BOM), then copy the Usage snippet below into your project.
kotlin
// build.gradle.kts (module)
dependencies {
implementation(platform("androidx.compose:compose-bom:2025.06.00"))
implementation("androidx.compose.material3:material3")
}Usage
kotlin
@Composable
fun TrashOpen(armed: Boolean) {
val lid by animateFloatAsState(if (armed) -28f else 0f, spring(stiffness = 300f), label = "lid")
val color = MaterialTheme.colorScheme.error
Box(Modifier.size(40.dp), contentAlignment = Alignment.Center) {
Icon(Icons.Filled.Delete, "Delete", tint = color, modifier = Modifier.size(30.dp))
Icon(Icons.Filled.HorizontalRule, null, tint = color,
modifier = Modifier.size(18.dp).offset(y = (-9).dp)
.graphicsLayer { rotationZ = lid; transformOrigin = TransformOrigin(0.1f, 0.5f) })
}
}