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
public companion object
Properties
Unspecified
public val Unspecified: KeyboardType
The keyboard type is not specified.
Text
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
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
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
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
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.
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
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
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
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
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
public val PostalAddress: KeyboardType
Optimizes the keyboard for entering shipping or mailing addresses.
PersonName
public val PersonName: KeyboardType
Optimizes the keyboard for entering names, typically capitalizing each word.
EmailSubject
public val EmailSubject: KeyboardType
Optimizes the keyboard for email subject lines.
ShortMessage
public val ShortMessage: KeyboardType
Optimizes the keyboard for sending short instant messages (SMS).
LongMessage
public val LongMessage: KeyboardType
Optimizes the keyboard for writing emails or other long-form content.
Filter
public val Filter: KeyboardType
Optimizes the keyboard for filtering lists or search queries.
Phonetic
public val Phonetic: KeyboardType
Keyboard layout optimized for entering phonetic spellings or pronunciation guides.
DateTime
public val DateTime: KeyboardType
Displays a numeric keypad optimized for entering both dates and times.
Date
public val Date: KeyboardType
Displays a numeric keypad optimized for date entry, typically containing / or -.
Time
public val Time: KeyboardType
Displays a numeric keypad optimized for time entry, typically containing :.
NumberSigned
public val NumberSigned: KeyboardType
Displays a numeric keypad showing 0-9 and a negative/positive sign key (+/-).
DecimalSigned
public val DecimalSigned: KeyboardType
Displays a numeric keypad showing 0-9, decimal separators, and sign keys.
DecimalPassword
public val DecimalPassword: KeyboardType
Shows a masked numeric keypad containing decimal separators.
NumberPasswordSigned
public val NumberPasswordSigned: KeyboardType
Shows a masked numeric keypad containing positive/negative signs.
DecimalPasswordSigned
public val DecimalPasswordSigned: KeyboardType
Shows a masked numeric keypad containing both decimal separators and signs.