# TextObfuscationMode

Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/text/input/TextObfuscationMode.kt+class:androidx.compose.foundation.text.input.TextObfuscationMode) Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0) Common/All
- Cmn

  ```
  value class TextObfuscationMode
  ```

*** ** * ** ***

Defines how the text will be obscured in secure text fields.

Text obscuring refers to replacing the original text content with a mask via various methods. It is most common in password fields.

Users are generally accustomed to different default experiences for secure text input on various platforms. On desktop, the convention is to keep the input entirely hidden. Conversely, mobile platforms typically offer a brief reveal of the last typed character. This reveal lasts for a short duration or until another character is entered, aiding users in tracking their input while maintaining privacy by not exposing too much information.

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextObfuscationMode` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextObfuscationMode#Hidden()` All characters are hidden. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextObfuscationMode` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextObfuscationMode#RevealLastTyped()` Reveals the last typed character for a short amount of time. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextObfuscationMode` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextObfuscationMode#System()` Gives the choice to the platform to hide or show characters. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextObfuscationMode` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextObfuscationMode#Visible()` Do not obscure any content, making all the content visible. | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextObfuscationMode#value()` | Cmn |

## Public companion properties

### Hidden

Cmn Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0)

```
val Hidden: TextObfuscationMode
```

All characters are hidden.

### RevealLastTyped

Cmn Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0)

```
val RevealLastTyped: TextObfuscationMode
```

Reveals the last typed character for a short amount of time.

Forces reveal behavior regardless of platform settings. For platform-dependent behavior, e.g. Androids "Show Passwords" setting, use `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextObfuscationMode#System()`.

### System

Cmn

```
val System: TextObfuscationMode
```

Gives the choice to the platform to hide or show characters.

On most platforms, the behavior depends on that platform's conventions (typically defaulting to `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextObfuscationMode#Hidden()`).

Android Specific: If the system setting is set to "Show" this setting mimics `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextObfuscationMode#RevealLastTyped()`, otherwise it mimics `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextObfuscationMode#Hidden()`. Additionally, there are differences, depending on the SDK version:

- SDK 37 and later: Respects granular platform settings that can differentiate between touch input and physical keyboard input.

- Below SDK 37: Respects the system-wide "Show passwords" toggle (`Settings.System.TEXT_SHOW_PASSWORD`) for all input types.

### Visible

Cmn Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0)

```
val Visible: TextObfuscationMode
```

Do not obscure any content, making all the content visible.

It can be useful when you want to briefly reveal the content by toggling a reveal icon.

## Public properties

### value

Cmn Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0)

```
val value: Int
```