Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular/material2 mat-spinner resize

Is there any possible way to change size of mat-spinner or mat-progress-circle?

I read the documentation of mat-spinner and mat-progress-circle but they said that mat-diameter is discontinued and the spinner will take the parent element's size.

How can I put mat-spinner in a mat-button to the left corner without changing the height of the button?

<button mat-button>    <mat-spinner style="float:left;"></mat-spinner>     processing.... </button> 

I also tried to change the height using in-line css like

style="float:left;height:10px;width:10px; 

but is not pretty to see.

like image 818
Vijay R Avatar asked Nov 17 '16 11:11

Vijay R


People also ask

How do you change the size of a mat spinner?

The default height and width of mat-spinner is “100px”. To change the size of mat-spinner we have to use diameter property.


2 Answers

With the latest update you should use the diameter property:

<mat-spinner [diameter]="70"></mat-spinner> 

The diameter represents the amount of pixels for both the width and the height of the spinner. In this case it has a size of 70x70 pixels.

See the following stackblitz example:

https://stackblitz.com/edit/angular-material2-progress-spinner

like image 166
Philipp Kief Avatar answered Sep 19 '22 13:09

Philipp Kief


here is the answer :

<mat-spinner mode="indeterminate" style="margin:0 auto;" [diameter]="30"></mat-spinner>  
like image 36
Tuba Salçi Avatar answered Sep 19 '22 13:09

Tuba Salçi