# KeyboardType

Artifact: [androidx.compose.ui:ui-text](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/text/input/KeyboardType.kt+class:androidx.compose.ui.text.input.KeyboardType) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  value class KeyboardType
  ```

*** ** * ** ***

The keyboard type to be used in `KeyboardOptions`.

Note that this input type is honored by keyboard and shows corresponding keyboard but this is not guaranteed. For example, some keyboards may send non-ASCII character even if you set `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Ascii()`.

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Ascii()` Forces the keyboard to display Latin characters. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Date()` Displays a numeric keypad optimized for date entry, typically containing `/` or `-`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#DateTime()` Displays a numeric keypad optimized for entering both dates and times. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Decimal()` Displays a numeric keypad containing a decimal point key (`.` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#DecimalPassword()` Shows a masked numeric keypad containing decimal separators. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#DecimalPasswordSigned()` Shows a masked numeric keypad containing both decimal separators and signs. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#DecimalSigned()` Displays a numeric keypad showing 0-9, decimal separators, and sign keys. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Email()` Optimizes the keyboard for typing email addresses. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#EmailSubject()` Optimizes the keyboard for email subject lines. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Filter()` Optimizes the keyboard for filtering lists or search queries. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#LongMessage()` Optimizes the keyboard for writing emails or other long-form content. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Number()` Displays a numeric keypad with only digits 0-9. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#NumberPassword()` Shows a masked numeric keypad (0-9) for secure PIN entry. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#NumberPasswordSigned()` Shows a masked numeric keypad containing positive/negative signs. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#NumberSigned()` Displays a numeric keypad showing 0-9 and a negative/positive sign key (`+/-`). | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Password()` Shows a standard masked text-based keyboard layout. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#PasswordVisible()` Shows a text-based password layout, but the typed text remains visible (unmasked). | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#PersonName()` Optimizes the keyboard for entering names, typically capitalizing each word. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Phone()` Displays a telephone dialer keypad. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Phonetic()` Keyboard layout optimized for entering phonetic spellings or pronunciation guides. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#PostalAddress()` Optimizes the keyboard for entering shipping or mailing addresses. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#ShortMessage()` Optimizes the keyboard for sending short instant messages (SMS). | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Text()` Shows the standard text-based keyboard layout with auto-capitalization and spelling suggestions. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Time()` Displays a numeric keypad optimized for time entry, typically containing `:`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Unspecified()` The keyboard type is not specified. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Uri()` Optimizes the keyboard for typing web links / URLs. | Cmn |

| ### Public functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#toString()()` | Cmn |

## Public companion properties

### Ascii

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

```
val Ascii: KeyboardType
```

Forces the keyboard to display Latin characters.

**When to use it**: Ideal for usernames, system database IDs, or passcodes where you want to restrict input to Latin characters.

Note: Unlike other technical input types (like `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Uri()` or `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Email()`) which typically disable auto-correct automatically, this type does not. Use `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/KeyboardOptions#autoCorrectEnabled()` to disable it if needed.

### Date

Cmn

```
val Date: KeyboardType
```

Displays a numeric keypad optimized for date entry, typically containing `/` or `-`.

### DateTime

Cmn

```
val DateTime: KeyboardType
```

Displays a numeric keypad optimized for entering both dates and times.

### Decimal

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

```
val Decimal: KeyboardType
```

Displays a numeric keypad containing a decimal point key (`.` or `,` depending on locale).

**When to use it**: Entering numbers that require decimal points, such as prices, weights, or coordinates.

### DecimalPassword

Cmn

```
val DecimalPassword: KeyboardType
```

Shows a masked numeric keypad containing decimal separators.

### DecimalPasswordSigned

Cmn

```
val DecimalPasswordSigned: KeyboardType
```

Shows a masked numeric keypad containing both decimal separators and signs.

### DecimalSigned

Cmn

```
val DecimalSigned: KeyboardType
```

Displays a numeric keypad showing 0-9, decimal separators, and sign keys.

### Email

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

```
val Email: KeyboardType
```

Optimizes the keyboard for typing email addresses. Prominently displays `@` and `.` near the spacebar.

**When to use it**: Login credential lines or registration forms.

Note: IMEs typically disable auto-correct for this type.

### EmailSubject

Cmn

```
val EmailSubject: KeyboardType
```

Optimizes the keyboard for email subject lines.

### Filter

Cmn

```
val Filter: KeyboardType
```

Optimizes the keyboard for filtering lists or search queries.

### LongMessage

Cmn

```
val LongMessage: KeyboardType
```

Optimizes the keyboard for writing emails or other long-form content.

### Number

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

```
val Number: KeyboardType
```

Displays a numeric keypad with only digits 0-9.

**When to use it**: Perfect for plain positive integers (e.g., specifying item counts, loops, or maximum history buffer settings).

Note: Lacks decimal points and positive/negative (+/-) signs.

### NumberPassword

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

```
val NumberPassword: KeyboardType
```

Shows a masked numeric keypad (0-9) for secure PIN entry.

**When to use it**: Entering masked 4-digit employee authentication PINs, lockscreen passcodes, or secure one-time verification codes (OTPs).

### NumberPasswordSigned

Cmn

```
val NumberPasswordSigned: KeyboardType
```

Shows a masked numeric keypad containing positive/negative signs.

### NumberSigned

Cmn

```
val NumberSigned: KeyboardType
```

Displays a numeric keypad showing 0-9 and a negative/positive sign key (`+/-`).

### Password

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

```
val Password: KeyboardType
```

Shows a standard masked text-based keyboard layout. Masks all typed characters with dots/asterisks for privacy.

**When to use it**: Secured credentials or login screens.

Note: Disables autocorrect and spelling suggestions, and prevents the keyboard from learning your text.

### PasswordVisible

Cmn

```
val PasswordVisible: KeyboardType
```

Shows a text-based password layout, but the typed text remains visible (unmasked).

**When to use it** : Toggle visibility password text fields. Pair it with standard `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Password()` (masked) using an eye-icon button to let the user reveal what they typed.

### PersonName

Cmn

```
val PersonName: KeyboardType
```

Optimizes the keyboard for entering names, typically capitalizing each word.

### Phone

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

```
val Phone: KeyboardType
```

Displays a telephone dialer keypad. Includes numbers 0-9, and symbols like `*`, `#`, and `+` for phone number formatting.

**When to use it**: Phone number input fields.

### Phonetic

Cmn

```
val Phonetic: KeyboardType
```

Keyboard layout optimized for entering phonetic spellings or pronunciation guides.

### PostalAddress

Cmn

```
val PostalAddress: KeyboardType
```

Optimizes the keyboard for entering shipping or mailing addresses.

### ShortMessage

Cmn

```
val ShortMessage: KeyboardType
```

Optimizes the keyboard for sending short instant messages (SMS).

### Text

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

```
val Text: KeyboardType
```

Shows the standard text-based keyboard layout with auto-capitalization and spelling suggestions.

**When to use it**: For standard text entries (e.g. chat messaging, renaming folders/routines, or general comments).

### Time

Cmn

```
val Time: KeyboardType
```

Displays a numeric keypad optimized for time entry, typically containing `:`.

### Unspecified

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

```
val Unspecified: KeyboardType
```

The keyboard type is not specified.

### Uri

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

```
val Uri: KeyboardType
```

Optimizes the keyboard for typing web links / URLs. Prominently displays `/` and `.com` shortcuts next to the spacebar to save keystrokes.

**When to use it**: Web address and URL entry forms.

Note: IMEs typically disable auto-correct and suggestions for this type.

## Public functions

### toString

Cmn

```
open fun toString(): String
```