PasswordInput

fun PasswordInput(label: String, value: String, passwordHidden: Boolean, onValueChange: (String) -> Unit, onPasswordHiddenChange: (Boolean) -> Unit, modifier: Modifier = Modifier, placeholderText: String = "", helperText: String = "", state: TextInputState = TextInputState.Enabled, keyboardOptions: KeyboardOptions = PasswordKeyboardOptions, keyboardActions: KeyboardActions = KeyboardActions.Default, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() })

Password input

Password input is a sub-variant of text input. It is used to collect private data and will hide the characters as a user enters them. A user can choose to toggle on the character visibility by clicking the view icon on the far right of the input field. When using a password input be sure to provide detailed helper text listing any requirements related to the data format, such as types of characters allowed or date structure.

(From Password input documentation)

Parameters

label

Text that informs the user about the content they need to enter in the field.

value

The input String text to be shown in the text input.

passwordHidden

Whether the password should be hidden or not.

onValueChange

The callback that is triggered when the input service updates the text. An updated text comes as a parameter of the callback.

onPasswordHiddenChange

Callback that is triggered when the user requests to hide the password.

modifier

Optional Modifier for this text input.

placeholderText

Optionnal text that provides hints or examples of what to enter.

helperText

Optional helper text is pertinent information that assists the user in correctly completing a field. It is often used to explain the correct data format.

state

The interactive state of the text input.

keyboardOptions

software keyboard options that contains configuration such as KeyboardType and ImeAction. Defaults to PasswordKeyboardOptions.

keyboardActions

when the input service emits an IME action, the corresponding callback is called. Note that this IME action may be different from what you specified in KeyboardOptions.imeAction.

interactionSource

the MutableInteractionSource representing the stream of Interactions for this TextField. You can create and pass in your own remembered MutableInteractionSource if you want to observe Interactions and customize the appearance / behavior of this TextField in different Interactions.