API reference for Angular Material input

import {MatInputModule} from '@angular/material/input';

Directive that allows a native input to work inside a MatFormField.

Selector: input[matInput] textarea[matInput] select[matNativeControl] input[matNativeControl] textarea[matNativeControl]

Exported as: matInput
Properties
Name Description
@Input()

errorStateMatcher: ErrorStateMatcher

An object used to control when error messages are shown.

@Input()

readonly: boolean

Whether the element is readonly.

@Input()

type: string

Input type of the element.

errorState: boolean

Whether the component is in an error state.

Methods
focus

Focuses the input.

Parameters

options?

FocusOptions

updateErrorState

Updates the error state based on the provided error state matcher.

This token is used to inject the object whose value should be set into MatInput. If none is provided, the native HTMLInputElement is used. Directives like MatDatepickerInput can provide themselves for this token, in order to make MatInput delegate the getting and setting of the value to them.

const MAT_INPUT_VALUE_ACCESSOR: InjectionToken<{ value: any; }>;