Command
Change theme
Light
Dark
System
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 CommandSubpage(onBack: () -> Unit) {
Card(shape = RoundedCornerShape(16.dp)) {
Column(Modifier.padding(vertical = 8.dp)) {
Row(
Modifier.padding(horizontal = 12.dp, vertical = 4.dp),
verticalAlignment = Alignment.CenterVertically,
) {
IconButton(onClick = onBack) {
Icon(Icons.AutoMirrored.Filled.ArrowBack, "Back",
Modifier.size(18.dp))
}
Text("Change theme", style = MaterialTheme.typography.labelMedium)
}
HorizontalDivider()
listOf("Light", "Dark", "System").forEach { opt ->
ListItem(
headlineContent = { Text(opt) },
leadingContent = { Icon(Icons.Outlined.Circle, null,
Modifier.size(18.dp)) },
modifier = Modifier.clickable {},
)
}
}
}
}