...
Every input should have a
mat-form-field
container, which formats its' content styles and spacing, and facilitates spacing for any required input field error messages.
Label
Use
<label>
for input labels
...
Use
matInput
for all instances of<input type="text">
...
Input Hint
...
Use
<mat-hint>
container if the input is required and needs a ‘required message' e.g. This field is required or if the field has HTML5 input validation, e.g. email format check
If an input is required, add
class=”required”
to the label, which will add a red asterix after the label to indicate the field must be completed
...
Disabled Inputs
Use
disabled
tag within input, which will automatically pull in disabled input stylingCode Block language html <input matInput type="text" disabled="disabled"> OR <input matInput type="text" disabled>
...