Text Field

Text fields let users enter text into a UI.

<md-outlined-text-field label="Labelled" placeholder="Placeholder"></md-outlined-text-field>
<md-filled-text-field label="Labelled" placeholder="Placeholder"></md-filled-text-field>

Properties

NameTypeDefaultDescription
labelString''The label text for the text field.
supportingTextString''Helper text displayed below the text field.
typeString'text'The input type (inherited from Input).
valueString''The current value of the text field (inherited from Input).
placeholderString''The placeholder text when the field is empty (inherited from Input).
requiredBooleanfalseWhether the text field is required (inherited from Input).
readOnlyBooleanfalseWhether the text field is read-only (inherited from Input).
multipleBooleanfalseWhether the text field accepts multiple values (inherited from Input).
minString''Minimum value for number/date inputs (inherited from Input).
maxString''Maximum value for number/date inputs (inherited from Input).
stepString''Step value for number inputs (inherited from Input).
minLengthNumber-1Minimum length for text inputs (inherited from Input).
maxLengthNumber-1Maximum length for text inputs (inherited from Input).
patternString''Regular expression pattern for validation (inherited from Input).
autocompleteString''Autocomplete behavior hint (inherited from Input).
focusedBooleanfalseWhether the text field is focused (inherited from Input).
disabledBooleanfalseWhether the text field is disabled (inherited from FormAssociated).

Methods

NameDescription
focus()Focuses the text field.
blur()Removes focus from the text field.
select()Selects the text content of the field.