Angular Material v22 introduces built-in loading button support via two new APIs: the `showProgress` input on `matButton` and the `progressIndicator` attribute on a projected element. The old approach required manually swapping button content with a spinner using `@if`, which caused layout width jumps as the button resized. The new approach keeps the label in the DOM while the spinner is shown, preventing the janky resize. The `progressIndicator` slot accepts any custom loading element, not just `mat-progress-spinner`, making it flexible for custom design systems.

5m read timeFrom itnext.io
Post cover image

Sort: