androidx.compose.foundation.text
KeyboardOptions
Class · from org.jetbrains.compose.foundation:foundation:1.12.2
No hand-written docs yet.
The keyboard configuration options for TextFields. It is not guaranteed if software keyboard will comply with the options provided here.
class KeyboardOptions(
capitalization: KeyboardCapitalization = KeyboardCapitalization.Unspecified,
autoCorrectEnabled: Boolean? = null,
keyboardType: KeyboardType = KeyboardType.Unspecified,
imeAction: ImeAction = ImeAction.Unspecified,
platformImeOptions: PlatformImeOptions? = null,
showKeyboardOnFocus: Boolean? = null,
hintLocales: LocaleList? = null,
)
How to get one
Create it
KeyboardOptions(capitalization, autoCorrectEnabled, keyboardType, imeAction, platformImeOptions, showKeyboardOnFocus, hintLocales)constructor
Ready-made values and functions that return it
Used by
Parameters that take a KeyboardOptions.
BasicSecureTextField(keyboardOptions)BasicTextField(keyboardOptions)KeyboardOptions.merge(other)OutlinedSecureTextField(keyboardOptions)OutlinedTextField(keyboardOptions)SearchBarDefaults.InputField(keyboardOptions)SecureTextField(keyboardOptions)TextField(keyboardOptions)
Properties
Default
val Default: KeyboardOptions
Default KeyboardOptions. Please see parameter descriptions for default values.
capitalization
val capitalization: KeyboardCapitalization
autoCorrectEnabled
val autoCorrectEnabled: Boolean?
keyboardType
val keyboardType: KeyboardType
imeAction
val imeAction: ImeAction
platformImeOptions
val platformImeOptions: PlatformImeOptions?
showKeyboardOnFocus
val showKeyboardOnFocus: Boolean?
hintLocales
val hintLocales: LocaleList?
Functions
copy
fun copy(
capitalization: KeyboardCapitalization = this.capitalization,
autoCorrectEnabled: Boolean? = this.autoCorrectEnabled,
keyboardType: KeyboardType = this.keyboardType,
imeAction: ImeAction = this.imeAction,
platformImeOptions: PlatformImeOptions? = this.platformImeOptions,
showKeyboardOnFocus: Boolean? = null,
hintLocales: LocaleList? = null,
): KeyboardOptions
Returns a copy of this object with the values passed to this method.
merge
fun merge(other: KeyboardOptions?): KeyboardOptions
Returns a new KeyboardOptions that is a combination of this options and a given other options.
Library docs
The keyboard configuration options for TextFields. It is not guaranteed if software keyboard will comply with the options provided here.