it's only work with .css. You enclose two button mat-icon-button inside a wrapper div matSuffix
An example (disclammer, really I'm not very good in css, pretty sure there're better ways to get the same
.wrapper-indicator{
position:relative;
height:1.5rem;
width:1.5rem;
overflow:none;
}
.wrapper-indicator .up,.wrapper-indicator .down{
position:absolute;
right: 0;
font-size:.5em;
height: 1.25rem!important;
width: 1.25rem!important;
}
.wrapper-indicator .up{
top:-.25rem;
}
.wrapper-indicator .down{
top:1rem;
}
And use
<mat-form-field appearance="fill" floatLabel="always">
<mat-label>Amount</mat-label>
<input matInput type="number" class="example-right-align" placeholder="0">
<div matSuffix class="wrapper-indicator">
<button class="up" mat-icon-button >
<mat-icon>expand_less</mat-icon>
</button>
<button class="down" mat-icon-button >
<mat-icon>expand_more</mat-icon>
</button>
</div>
</mat-form-field>
Update mat-input create a spinner directly is you use type="number". strange, when I made the input don't show the "spinner". Taking a look about the code in github, the "type" is a @Input
, so imagine that it's necesary write type="number"
after matInput
almost in old version of Angular