Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular Material progress spinner in-line

Is it possible to have the Angular Material progress spinner appear in-line with the text and roughly the size of a character?

I want something like:

<span>please wait <mat-spinner></mat-spinner></span>

where the spinner just appears in-line with the 'please wait' text.

Is this possible?

I have had a look at the docs and the examples provided but none of them seem to offer a way forward and a Google + search of StackOverflow didn't turn anything up.

like image 534
Stewart_R Avatar asked Feb 06 '19 09:02

Stewart_R


People also ask

How do you use mat progress bar?

To use progress bars we need to simply use <mat-progress-bar> tag. They are many types of progress bars like determinate, indeterminate, buffer and etc. In-order to show the progress we need to give a value property to the tag. If we want to change the theme then we can change it by using the color property.


1 Answers

You can use the display: flex on the wrapping element. To set the size of it, you can use the diameter input:

<div class="spinner-wrapper">
  <span>please wait</span>
  <mat-spinner [diameter]="12"></mat-spinner>
</div>

.spinner-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

See a working example here

like image 124
Poul Kruijt Avatar answered Oct 21 '22 23:10

Poul Kruijt