I have input element in Angular Material:
you can set your appearance to none in mat-form-field tag like this :
<mat-form-field class="header-search-form-field" appearance="none">
<mat-label>search</mat-label>
<input matInput placeholder="add product/>
</mat-form-field>
The other answers didn't work for me, but this did:
md-input-container input {
border: none;
}
This worked for me:
::ng-deep .mat-form-field-underline {
display: none;
}
Add it to the component's scss or css
This worked for me
.mat-form-field-appearance-legacy .mat-form-field-underline {
height: 0 !important;
}
I was playing a bit with the appearance property of mat-form-field
and found that if you put a "none" value (or any other unsupported value), you will get clear input.
The code:
<mat-form-field appearance="none">
<mat-label>"None" form field</mat-label>
<input matInput placeholder="Placeholder">
</mat-form-field>
StackBlitz demo (edited from the official angular demo).
The original example can be found here: Form field appearance variants.
I admit, this is a little bit of a hack.
::ng-deep .mat-form-field-underline {
display: none;
}
the above code will remove the default black underline
::ng-deep .mat-form-field-ripple {
display: none;
}
this will remove the on focus ripple effect