🌈 Create new beautiful Compose Gradients with our new wesite ->
Class

KeyboardType

The keyboard type to be used in KeyboardOptions.

Source set: Common
public class KeyboardType private constructor(@Suppress("unused") private val value: Int)

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 KeyboardType.Ascii.

Members

Companion

Source set: Common
public companion object

Properties

Unspecified

Source set: Common
public val Unspecified: KeyboardType

The keyboard type is not specified.

Text

Source set: Common
public 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).

Ascii

Source set: Common
public 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 Uri or Email) which typically disable auto-correct automatically, this type does not. Use androidx.compose.foundation.text.KeyboardOptions.autoCorrectEnabled to disable it if needed.

Number

Source set: Common
public 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.

Phone

Source set: Common
public 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.

Uri

Source set: Common
public 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.

Email

Source set: Common
public 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.

Password

Source set: Common
public 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.

NumberPassword

Source set: Common
public 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).

Decimal

Source set: Common
public 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.

PasswordVisible

Source set: Common
public 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 Password (masked) using an eye-icon button to let the user reveal what they typed.

PostalAddress

Source set: Common
public val PostalAddress: KeyboardType

Optimizes the keyboard for entering shipping or mailing addresses.

PersonName

Source set: Common
public val PersonName: KeyboardType

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

EmailSubject

Source set: Common
public val EmailSubject: KeyboardType

Optimizes the keyboard for email subject lines.

ShortMessage

Source set: Common
public val ShortMessage: KeyboardType

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

LongMessage

Source set: Common
public val LongMessage: KeyboardType

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

Filter

Source set: Common
public val Filter: KeyboardType

Optimizes the keyboard for filtering lists or search queries.

Phonetic

Source set: Common
public val Phonetic: KeyboardType

Keyboard layout optimized for entering phonetic spellings or pronunciation guides.

DateTime

Source set: Common
public val DateTime: KeyboardType

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

Date

Source set: Common
public val Date: KeyboardType

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

Time

Source set: Common
public val Time: KeyboardType

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

NumberSigned

Source set: Common
public val NumberSigned: KeyboardType

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

DecimalSigned

Source set: Common
public val DecimalSigned: KeyboardType

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

DecimalPassword

Source set: Common
public val DecimalPassword: KeyboardType

Shows a masked numeric keypad containing decimal separators.

NumberPasswordSigned

Source set: Common
public val NumberPasswordSigned: KeyboardType

Shows a masked numeric keypad containing positive/negative signs.

DecimalPasswordSigned

Source set: Common
public val DecimalPasswordSigned: KeyboardType

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