SecretTextField
fun SecretTextField(value: String, onValueChange: (String) -> Unit, label: String, modifier: Modifier = Modifier, enabled: Boolean = true, supportingText: String? = null, errorText: String? = null, imeAction: ImeAction = ImeAction.Default, keyboardActions: KeyboardActions = KeyboardActions.Default, showLabel: String = "Show", hideLabel: String = "Hide", revealToggle: SecretRevealToggle = SecretRevealToggle.TEXT)
A FormTextField for secrets such as API keys and passwords.
The value is masked by default and a trailing text button toggles visibility. The revealed state is intentionally not saved across configuration changes or process death so a secret is never restored in plain text. Clearing the value also hides it again, including when a form is reset. The keyboard is configured as a password keyboard with autocorrect disabled so the value is not learned by the IME.
revealToggle picks a text button (showLabel / hideLabel) or a compact eye icon. The icon uses the same labels as its accessibility description and tooltip.