Angular Material matInput content aligned to the right

15,631

Using the standard text-align CSS property should just work.

<input matInput class="right">

.right { text-align: right }
Share:
15,631
trashvin
Author by

trashvin

Updated on July 06, 2022

Comments

  • trashvin
    trashvin almost 2 years

    How do we align the input of matInput in Angular Material to the right?

    My current code:

    <mat-form-field>
      <input matInput type="number" id="amount" placeholder="Amount"
        [ngModel]="entry.amount | number :'1.2-2'"
        (ngModelChange)='entry.amount=$event' />
    </mat-form-field>
    

    Desired output :

    enter image description here