Input

Inputs that accept typed input from users

Contents

Keyboard Types

Hints the browser what kind of virtual keyboard to display when the input is focused. This is especially useful for mobile devices, where the keyboard type can make a big difference in the user experience.

Virtual Keyboard in Bits

To test the changes in this story, use a mobile device or install a virtual keyboard on your desktop. However note that this only a hint, it would still depend on the device's keyboard settings on which keyboard to display.

Currency

The currency input type automatically sets the proper keyboard type.

$
AUD

Numeric Type

The numeric type is for keyboard inputs that should only accept numbers. Devices may or may not show a minus key.

Decimal Type

Similar to the numeric type, the decimal type is for keyboard inputs that should only accept numbers that may have a decimal point.

Telephone Type

The telephone type is for keyboard inputs that should only accept numbers and symbols that are commonly used in phone numbers.

Inputs in Keyboard type
type : IsAny<T> extends true ? any : [T] extends [number] ? InputType.NUMBER | InputType.NUMBER_INCREMENT : [T] extends [string] ? InputType.CURRENCY | ... 4 more ... | InputType.SEARCH : never

Declared as an `@Input()` by each concrete component, which narrows it to the types that component actually renders. Not an input on its own.

afterLabel ?: string = ''
beforeLabel ?: string = ''
keyboardType ?: KeyboardType

Hints the browser what kind of virtual keyboard to display when the input is focused.

maxLength ?: number
Also set in this example
control : FormControl<T>
id ?: string
placeholder ?: string
Outputs
iconEndClick ?: any = new EventEmitter<MouseEvent>()
iconStartClick ?: any = new EventEmitter<MouseEvent>()
onBlur ?: any = new EventEmitter<void>()
onFocus ?: any = new EventEmitter<void>()