← ClaudeAtlas

android-text-input-formslisted

Text input and form patterns for Android/Compose - TextField vs OutlinedTextField, typed form state models, submit-time and change-time validation, KeyboardOptions and KeyboardActions, FocusRequester for focus traversal, password field toggles, multi-field scrollable forms, and mapping server-side validation errors through UiText. Use this skill whenever building login, registration, settings, or any multi-field input screen. Trigger on phrases like "form", "TextField", "input validation", "keyboard", "imeAction", "focus", "password field", "form state", "validation error", "OutlinedTextField", "KeyboardOptions", "FocusRequester", or "IME action".
lenorebreakneck630/claude-zero-to-hero-android-KMP · ★ 1 · API & Backend · score 64
Install: claude install-skill lenorebreakneck630/claude-zero-to-hero-android-KMP
# Android Text Input & Forms (Compose) ## Overview Compose form patterns centre on three concerns: state (what the user has typed, what errors exist), keyboard (type, IME actions, navigation), and focus (moving between fields programmatically). Get these three right and every form — login, registration, checkout, settings — follows the same pattern. --- ## TextField vs OutlinedTextField Both accept the same parameters. Choose based on your design system: ```kotlin // Filled style — appropriate for forms inside a Surface TextField( value = state.email, onValueChange = { onAction(FormAction.EmailChanged(it)) }, label = { Text("Email") }, modifier = Modifier.fillMaxWidth() ) // Outlined style — stands out on a plain background OutlinedTextField( value = state.email, onValueChange = { onAction(FormAction.EmailChanged(it)) }, label = { Text("Email") }, modifier = Modifier.fillMaxWidth() ) ``` Prefer `OutlinedTextField` in forms — the outline makes the input boundary obvious without requiring a filled background. Use `TextField` only if your design system explicitly uses the filled variant. --- ## Form State Model Model form state as a single data class in the ViewModel's `UiState`. Each field gets a `value` and an `error`. Errors are typed as `UiText?` (null = no error) so they can be string resources or dynamic strings from the server. ```kotlin // Presentation model — lives in feature:presentation data class RegisterFormState( val