Cards
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 ProfileStatsCard() {
ElevatedCard(
modifier = Modifier.width(300.dp),
shape = RoundedCornerShape(20.dp)
) {
Column(Modifier.padding(20.dp)) {
Row(verticalAlignment = Alignment.CenterVertically) {
Box(
Modifier.size(52.dp).clip(CircleShape)
.background(
MaterialTheme.colorScheme.primary
),
contentAlignment = Alignment.Center
) { Text("IZ") }
Spacer(Modifier.width(12.dp))
Text(
"Iris Zhao",
style = MaterialTheme.typography.titleMedium
)
}
Spacer(Modifier.height(16.dp))
Row(
Modifier.fillMaxWidth(),
horizontalArrangement =
Arrangement.SpaceBetween
) {
Stat("128", "Posts")
Stat("8.4k", "Followers")
Stat("312", "Following")
}
}
}
}
@Composable
private fun Stat(value: String, label: String) {
Column(horizontalAlignment = Alignment.CenterHorizontally) {
Text(
value,
style = MaterialTheme.typography.titleMedium,
fontWeight = FontWeight.Bold
)
Text(
label,
style = MaterialTheme.typography.labelSmall,
color = MaterialTheme.colorScheme.onSurfaceVariant
)
}
}