Docs
Forms
Compose forms with caveui inputs and buttons.
Combine caveui inputs with a CaveButton to build forms. State is hoisted with remember/mutableStateOf, and validation is just plain Kotlin — no form library required.
kotlin
var email by remember { mutableStateOf("") }
val isValid = email.contains("@")
Column(verticalArrangement = Arrangement.spacedBy(CaveTheme.spacing.md)) {
OutlinedTextField(
value = email,
onValueChange = { email = it },
label = { Text("Email") },
isError = email.isNotEmpty() && !isValid,
singleLine = true,
)
CaveButton(
text = "Subscribe",
onClick = { /* submit */ },
enabled = isValid,
)
}Browse the Inputs category for search fields, password inputs and more form-ready components.