Cards
Cards

Info Tip

A subtle informational tip card with a calm accent border.

<Card className="w-64 mx-auto bg-muted border-l-4 border-l-sky-500"> <CardContent className="flex gap-3 p-4"> <Info className="size-5 text-sky-500 shrink-0" /> <div className="flex flex-col"> <span className="text-sm font-semibold text-foreground">Pro tip</span> <span className="text-xs text-muted-foreground">Press ⌘K to open the command palette.</span> </div> </CardContent> </Card>

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 InfoTip() {
    Card(
        shape = RoundedCornerShape(14.dp),
        colors = CardDefaults.cardColors(
            containerColor = MaterialTheme.colorScheme.surfaceVariant
        ),
        modifier = Modifier.padding(12.dp)
    ) {
        Row(
            modifier = Modifier.padding(16.dp),
            horizontalArrangement = Arrangement.spacedBy(12.dp)
        ) {
            Icon(
                Icons.Rounded.Info,
                contentDescription = null,
                tint = MaterialTheme.colorScheme.primary
            )
            Column {
                Text("Pro tip", style = MaterialTheme.typography.titleSmall)
                Text(
                    "Press ⌘K to open the command palette.",
                    style = MaterialTheme.typography.bodySmall,
                    color = MaterialTheme.colorScheme.onSurfaceVariant
                )
            }
        }
    }
}