Skip to content

Keyboard Options

Keyboard options are hints for the virtual keyboard of mobile devices: which keyboard type to show and whether to capitalize and auto-correct. Pass them to a text field with its KeyboardOptions method.

TextField("E-mail", email.Get()).
	InputValue(email).
	KeyboardOptions(KeyboardOptions().
		KeyboardType(KeyboardEMail).
		Capitalization(false).
		AutoCorrectEnabled(false))

Keyboard types are hints only. Users may use other keyboards, paste text or send anything to your server, so always validate the input.

Constructors

ConstructorDescription
KeyboardOptions() TKeyboardOptionsCreates options without any hints.

The keyboard types are KeyboardDefault, KeyboardAscii, KeyboardInteger, KeyboardFloat, KeyboardEMail, KeyboardPhone, KeyboardSearch and KeyboardURL.

Methods

MethodDescription
AutoCorrectEnabled(autoCorrectEnabled bool) TKeyboardOptionsEnables or disables auto-correction.
Capitalization(capitalization bool) TKeyboardOptionsEnables or disables automatic capitalization.
KeyboardType(keyboardType KeyboardType) TKeyboardOptionsSets a hint for the keyboard type to show.

Related