diff --git a/src/dev-app/button/BUILD.bazel b/src/dev-app/button/BUILD.bazel
index c94c68c9b705..fe4c5d24315a 100644
--- a/src/dev-app/button/BUILD.bazel
+++ b/src/dev-app/button/BUILD.bazel
@@ -15,6 +15,7 @@ ng_project(
"//src/material/button",
"//src/material/checkbox",
"//src/material/icon",
+ "//src/material/progress-spinner",
"//src/material/tooltip",
],
)
diff --git a/src/dev-app/button/button-demo.html b/src/dev-app/button/button-demo.html
index 2d96f2740820..7e70494a204c 100644
--- a/src/dev-app/button/button-demo.html
+++ b/src/dev-app/button/button-demo.html
@@ -23,20 +23,20 @@
[matButton]="appearance"
disabled
[disabledInteractive]="disabledInteractive"
- [matTooltip]="tooltipText">{{appearance}}
+ [matTooltip]="tooltipText"
+ >
+ {{appearance}}
+
}
-
+ [matTooltip]="tooltipText"
+ >
+ check
+ Search
+ check
+
+
+
+ @for (appearance of appearances; track $index) {
+
+ {{appearance}}
+
+
+
+ }
+
+
+ check
+
+
+
+ check
+
+
+
+ Search
+
+
+
check
Search
check
@@ -82,32 +143,41 @@
[disabledInteractive]="disabledInteractive"
[matTooltip]="tooltipText"
matButton
- color="primary">SEARCH
+ color="primary"
+ >SEARCH
SEARCH
+ matButton="elevated"
+ >SEARCH
SEARCH
+ color="primary"
+ >SEARCH
SEARCH
+ matButton="filled"
+ >SEARCH
+ matFab
+ >
check
+ extended
+ >Search
+ extended
+ >
check
Search
check
@@ -139,7 +213,9 @@
@for (appearance of appearances; track $index) {
-
+
unthemed
primary
@@ -149,7 +225,10 @@
[matButton]="appearance"
disabled
[disabledInteractive]="disabledInteractive"
- [matTooltip]="tooltipText">disabled
+ [matTooltip]="tooltipText"
+ >
+ disabled
+
home
with icons
@@ -159,6 +238,17 @@
home
with icons
+
+
+ home
+ with icons
+
}
@@ -180,9 +270,20 @@
matIconButton
disabled
[disabledInteractive]="disabledInteractive"
- [matTooltip]="tooltipText">
+ [matTooltip]="tooltipText"
+ >
visibility
+
+
+ trending_up
+
@@ -204,7 +305,8 @@
matIconButton
disabled
[disabledInteractive]="disabledInteractive"
- [matTooltip]="tooltipText">
+ [matTooltip]="tooltipText"
+ >
visibility
@@ -223,13 +325,19 @@
home
-
+
favorite
+
+
+ home
+
@@ -246,11 +354,22 @@
filter_list
+
+
+ filter_list
+
+ [matTooltip]="tooltipText"
+ >
home
@@ -261,37 +380,106 @@
isDisabled: {{isDisabled}}
Button 1 as been clicked {{clickCounter}} times
- Allow disabled button interactivity
+ Allow disabled button interactivity
All disabled
+
+ All showProgress
+
Focus 1
Focus 2
Focus 3
Focus 4
-
+
Button 1
+
-
+
Button 2
+
-
+
Button 3
+
-
+
Button 4
+
-
+
check
+
-
+
favorite
+
diff --git a/src/dev-app/button/button-demo.ts b/src/dev-app/button/button-demo.ts
index b8b8fa4b42f3..79725c59bbb7 100644
--- a/src/dev-app/button/button-demo.ts
+++ b/src/dev-app/button/button-demo.ts
@@ -21,6 +21,7 @@ import {
} from '@angular/material/button';
import {MatCheckbox} from '@angular/material/checkbox';
import {MatIcon} from '@angular/material/icon';
+import {MatProgressSpinner} from '@angular/material/progress-spinner';
import {MatTooltip} from '@angular/material/tooltip';
@Component({
@@ -28,23 +29,25 @@ import {MatTooltip} from '@angular/material/tooltip';
templateUrl: 'button-demo.html',
styleUrl: 'button-demo.css',
imports: [
- MatButton,
+ FormsModule,
MatAnchor,
- MatFabButton,
+ MatButton,
+ MatCheckbox,
MatFabAnchor,
- MatMiniFabButton,
- MatMiniFabAnchor,
- MatIconButton,
- MatIconAnchor,
+ MatFabButton,
MatIcon,
+ MatIconAnchor,
+ MatIconButton,
+ MatMiniFabAnchor,
+ MatMiniFabButton,
+ MatProgressSpinner,
MatTooltip,
- MatCheckbox,
- FormsModule,
],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ButtonDemo {
isDisabled = false;
+ showProgress = false;
clickCounter = 0;
toggleDisable = false;
tooltipText = 'This is a button tooltip!';
diff --git a/src/material/button/BUILD.bazel b/src/material/button/BUILD.bazel
index 9e35c2644dd7..9671cabd541c 100644
--- a/src/material/button/BUILD.bazel
+++ b/src/material/button/BUILD.bazel
@@ -135,6 +135,7 @@ sass_binary(
"//src/material/core/style:private",
"//src/material/core/style:vendor_prefixes",
"//src/material/core/tokens:token_utils",
+ "//src/material/progress-spinner:theme",
],
)
diff --git a/src/material/button/_m3-button.scss b/src/material/button/_m3-button.scss
index 4d52673eb524..a388b17234cc 100644
--- a/src/material/button/_m3-button.scss
+++ b/src/material/button/_m3-button.scss
@@ -63,6 +63,7 @@
button-filled-pressed-state-layer-opacity:map.get($system, pressed-state-layer-opacity),
button-filled-ripple-color: m3-utils.color-with-opacity(
map.get($system, on-primary), map.get($system, pressed-state-layer-opacity)),
+ button-filled-progress-active-indicator-color: map.get($system, on-primary),
button-filled-state-layer-color: map.get($system, on-primary),
button-outlined-disabled-label-text-color:
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
diff --git a/src/material/button/button-base.ts b/src/material/button/button-base.ts
index c4e6957ef140..2c48ba787740 100644
--- a/src/material/button/button-base.ts
+++ b/src/material/button/button-base.ts
@@ -14,6 +14,7 @@ import {
ElementRef,
inject,
InjectionToken,
+ input,
Input,
NgZone,
numberAttribute,
@@ -55,6 +56,7 @@ function transformTabIndex(value: unknown): number | undefined {
// wants to target all Material buttons.
'class': 'mat-mdc-button-base',
'[class]': 'color ? "mat-" + color : ""',
+ '[class.mat-mdc-button-progress-indicator-shown]': 'showProgress()',
'[attr.disabled]': '_getDisabledAttribute()',
'[attr.aria-disabled]': '_getAriaDisabled()',
'[attr.tabindex]': '_getTabIndex()',
@@ -150,6 +152,9 @@ export class MatButtonBase implements AfterViewInit, OnDestroy {
this.tabIndex = value;
}
+ /** Whether the button is showing a progress indicator. */
+ readonly showProgress = input(false, {transform: booleanAttribute});
+
constructor(...args: unknown[]);
constructor() {
diff --git a/src/material/button/button.html b/src/material/button/button.html
index 0ddd2794ef91..b03f650aeb8f 100644
--- a/src/material/button/button.html
+++ b/src/material/button/button.html
@@ -1,16 +1,27 @@
+ class="mat-mdc-button-persistent-ripple"
+ [class.mdc-button__ripple]="!_isFab"
+ [class.mdc-fab__ripple]="_isFab"
+>
-
+
-
+
+@if (showProgress()) {
+
+
+
+}
+