Overlays
Overlaysanimated

Success dialog

A celebratory dialog with a springing check badge confirming a completed action.

Payment sent

Your transfer is on its way.

Done

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 SuccessDialog(onDone: () -> Unit) {
    Dialog(onDismissRequest = onDone) {
        Surface(shape = MaterialTheme.shapes.extraLarge) {
            Column(
                Modifier.padding(24.dp),
                horizontalAlignment = Alignment.CenterHorizontally,
            ) {
                val scale = remember { Animatable(0f) }
                LaunchedEffect(Unit) {
                    scale.animateTo(1f, spring(Spring.DampingRatioMediumBouncy))
                }
                Box(
                    Modifier.size(56.dp)
                        .graphicsLayer { scaleX = scale.value; scaleY = scale.value }
                        .clip(CircleShape).background(Color(0xFF16A34A)),
                    contentAlignment = Alignment.Center,
                ) {
                    Icon(Icons.Filled.Check, null, tint = Color.White)
                }
                Text("Payment sent", Modifier.padding(top = 16.dp),
                    style = MaterialTheme.typography.titleMedium)
                Text("Your transfer is on its way.",
                    color = MaterialTheme.colorScheme.onSurfaceVariant,
                    style = MaterialTheme.typography.bodySmall)
                Button(onClick = onDone, Modifier.padding(top = 16.dp).fillMaxWidth()) {
                    Text("Done")
                }
            }
        }
    }
}