Disclosures
Disclosuresanimated
Collapsible step
A numbered onboarding step that expands its body while others stay collapsed.
1
Connect your bank
Securely link an account in seconds with read-only access.
2
Set a budget
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 StepSection(index: Int, title: String, body: String, open: Boolean, onToggle: () -> Unit) {
val accent = Color(0xFF6366F1)
Row(Modifier.fillMaxWidth().clickable { onToggle() }.padding(vertical = 8.dp)) {
Box(
Modifier.size(26.dp).clip(CircleShape)
.background(if (open) accent
else MaterialTheme.colorScheme.surfaceVariant),
contentAlignment = Alignment.Center,
) {
Text(
"$index",
color = if (open) Color.White
else MaterialTheme.colorScheme.onSurfaceVariant,
style = MaterialTheme.typography.labelMedium,
)
}
Spacer(Modifier.width(12.dp))
Column(Modifier.weight(1f)) {
Text(title, style = MaterialTheme.typography.titleSmall)
AnimatedVisibility(open) {
Text(body, Modifier.padding(top = 4.dp),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant)
}
}
}
}