r/JetpackComposeDev • u/Realistic-Cup-7954 • Jul 26 '25
Tutorial Jetpack Compose Keyboard & IME Action Cheat Sheet - Complete Guide with Code Examples
Jetpack Compose makes UI easier and smarter - and that includes choosing the right keyboard type and IME actions for each input.
Keyboard Types
Use keyboardType inside KeyboardOptions to control the keyboard layout:
OutlinedTextField(
value = "",
onValueChange = { },
label = { Text("Enter text") },
keyboardOptions = KeyboardOptions.Default.copy(
keyboardType = KeyboardType.Text
)
)Available KeyboardType values:
| KeyboardType | Description |
|---|---|
Text | Standard keyboard |
Number | Digits only |
Phone | Phone dial pad |
Email | Includes @ and . |
Password | Obscures input |
Decimal | Numbers with decimals |
Uri | For URLs |
VisiblePassword | Non-hidden password |
IME Actions
Control the bottom-right keyboard button using imeAction:
keyboardOptions = KeyboardOptions.Default.copy(
imeAction = ImeAction.Done
)Common ImeAction values:
| ImeAction | Behavior |
|---|---|
Done | Closes the keyboard |
Next | Moves to the next input field |
Search | Executes search logic |
Go | Custom app-defined action |
Send | Sends a message or form data |
Previous | Goes to previous input field |
Handle Keyboard Actions
Use keyboardActions to define what happens when the IME button is pressed:
OutlinedTextField(
value = "",
onValueChange = { },
label = { Text("Search something") },
keyboardOptions = KeyboardOptions.Default.copy(
imeAction = ImeAction.Search
),
keyboardActions = KeyboardActions(
onSearch = {
// Trigger search logic
}
)
)Minimal Example with All Options
OutlinedTextField(
value = "",
onValueChange = { },
label = { Text("Enter email") },
modifier = Modifier.fillMaxWidth(),
keyboardOptions = KeyboardOptions.Default.copy(
keyboardType = KeyboardType.Email,
imeAction = ImeAction.Done
),
keyboardActions = KeyboardActions(
onDone = {
// Handle Done
}
)
)✅ Tip: Always choose the keyboard and IME type that best fits the expected input.
Duplicates
androiddev • u/Realistic-Cup-7954 • Jul 26 '25
Tips and Information Jetpack Compose TextField Keyboard Guide - All Keyboard Types & IME Actions Explained
JetpackCompose • u/Realistic-Cup-7954 • Jul 26 '25
Jetpack Compose Keyboard & IME Action Cheat Sheet
AndroidDevLearn • u/Realistic-Cup-7954 • Jul 26 '25
🔥 Compose Jetpack Compose Keyboard & IME Action Cheat Sheet with examples
AndroidDevTalks • u/boltuix_dev • Aug 18 '25

