FormField
A control interface for managing individual form field state and interactions.
This interface provides access to field state (value, validation errors, focus state) and methods for handling user interactions (value changes, focus events, validation triggers). It serves as the bridge between the form field UI and the underlying form state management.
Usage:
form.Field(
selector = { it.email },
updater = { copy(email = it) },
render = { field ->
TextField(
value = field.value,
onValueChange = field::onValueChange,
isError = field.hasError,
modifier = Modifier.onFocusChanged { state ->
field.handleFocus(state.isFocused)
}
)
}
)
Content copied to clipboard
Parameters
V
The type of the field value.