Cards
Cardsanimated

Split Bill

Split bill card with member avatars that cascade in and a per-person total.

Dinner Split
ACJMTRLK
Total $128
4 people
$32 each

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 SplitBillCard() {
  val people = listOf("AC", "JM", "TR", "LK")
  Card(
    modifier = Modifier.fillMaxWidth().padding(16.dp),
    shape = RoundedCornerShape(20.dp)
  ) {
    Column(Modifier.padding(20.dp)) {
      Text("Dinner Split",
        style = MaterialTheme.typography.titleSmall,
        fontWeight = FontWeight.SemiBold)
      Spacer(Modifier.height(14.dp))
      Row {
        people.forEachIndexed { i, p ->
          val a = remember { Animatable(0f) }
          LaunchedEffect(Unit) {
            delay(i * 100L); a.animateTo(1f, tween(300))
          }
          Box(
            Modifier
              .offset(x = (i * -8).dp)
              .size(38.dp)
              .graphicsLayer { scaleX = a.value; scaleY = a.value }
              .background(
                MaterialTheme.colorScheme.primaryContainer,
                CircleShape
              ),
            contentAlignment = Alignment.Center
          ) { Text(p, style = MaterialTheme.typography.labelSmall) }
        }
      }
      Spacer(Modifier.height(16.dp))
      Row(Modifier.fillMaxWidth()) {
        Column(Modifier.weight(1f)) {
          Text("Total $128",
            style = MaterialTheme.typography.bodyMedium)
          Text("4 people",
            style = MaterialTheme.typography.bodySmall,
            color = MaterialTheme.colorScheme.onSurfaceVariant)
        }
        Text("$32 each", fontWeight = FontWeight.Bold)
      }
    }
  }
}