Skip to content

Commit e254b2f

Browse files
authored
docs(material/progress-bar): Update description and examples for color input description on API page (#29331)
1 parent 701c4fd commit e254b2f

File tree

4 files changed

+18
-28
lines changed

4 files changed

+18
-28
lines changed

src/components-examples/material/progress-bar/progress-bar-configurable/progress-bar-configurable-example.html

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,6 @@
22
<mat-card-content>
33
<h2 class="example-h2">Progress bar configuration</h2>
44

5-
<section class="example-section">
6-
<label class="example-margin">Color:</label>
7-
<mat-radio-group [(ngModel)]="color">
8-
<mat-radio-button class="example-margin" value="primary">
9-
Primary
10-
</mat-radio-button>
11-
<mat-radio-button class="example-margin" value="accent">
12-
Accent
13-
</mat-radio-button>
14-
<mat-radio-button class="example-margin" value="warn">
15-
Warn
16-
</mat-radio-button>
17-
</mat-radio-group>
18-
</section>
19-
205
<section class="example-section">
216
<label class="example-margin">Mode:</label>
227
<mat-radio-group [(ngModel)]="mode">
@@ -61,7 +46,6 @@ <h2 class="example-h2">Result</h2>
6146
<section class="example-section">
6247
<mat-progress-bar
6348
class="example-margin"
64-
[color]="color"
6549
[mode]="mode"
6650
[value]="value"
6751
[bufferValue]="bufferValue">

src/components-examples/material/progress-bar/progress-bar-configurable/progress-bar-configurable-example.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {Component} from '@angular/core';
2-
import {ThemePalette} from '@angular/material/core';
32
import {ProgressBarMode, MatProgressBarModule} from '@angular/material/progress-bar';
43
import {MatSliderModule} from '@angular/material/slider';
54
import {FormsModule} from '@angular/forms';
@@ -17,7 +16,6 @@ import {MatCardModule} from '@angular/material/card';
1716
imports: [MatCardModule, MatRadioModule, FormsModule, MatSliderModule, MatProgressBarModule],
1817
})
1918
export class ProgressBarConfigurableExample {
20-
color: ThemePalette = 'primary';
2119
mode: ProgressBarMode = 'determinate';
2220
value = 50;
2321
bufferValue = 75;

src/material/progress-bar/progress-bar.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
The progress-bar supports four modes: determinate, indeterminate, buffer and query.
55

66
#### Determinate
7-
Operations where the percentage of the operation complete is known should use the
7+
Operations where the percentage of the operation complete is known should use the
88
determinate indicator.
99

1010
<!-- example(progress-bar-determinate) -->
1111

1212
This is the default mode and the progress is represented by the `value` property.
1313

1414
#### Indeterminate
15-
Operations where the user is asked to wait while something finishes and it’s
15+
Operations where the user is asked to wait while something finishes and it’s
1616
not necessary to indicate how long it will take should use the indeterminate indicator.
1717

1818
<!-- example(progress-bar-indeterminate) -->
@@ -24,7 +24,7 @@ Use the `buffer` mode of the progress-bar to indicate some activity or loading f
2424

2525
<!-- example(progress-bar-buffer) -->
2626

27-
In "buffer" mode, `value` determines the progress of the primary bar while the `bufferValue` is
27+
In "buffer" mode, `value` determines the progress of the primary bar while the `bufferValue` is
2828
used to show the additional buffering progress.
2929

3030
#### Query
@@ -33,14 +33,10 @@ Use the `query` mode of the progress-bar to indicate pre-loading before the actu
3333

3434
<!-- example(progress-bar-query) -->
3535

36-
In "query" mode, the progress-bar renders as an inverted "indeterminate" bar. Once the response
36+
In "query" mode, the progress-bar renders as an inverted "indeterminate" bar. Once the response
3737
progress is available, the `mode` should be changed to determinate to convey the progress. In
3838
this mode the `value` property is ignored.
3939

40-
### Theming
41-
The color of a progress-bar can be changed by using the `color` property. By default, progress-bars
42-
use the theme's primary color. This can be changed to `'accent'` or `'warn'`.
43-
4440
### Accessibility
4541

4642
`MatProgressBar` implements the ARIA `role="progressbar"` pattern. By default, the progress bar

src/material/progress-bar/progress-bar.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ export interface ProgressAnimationEnd {
3535

3636
/** Default `mat-progress-bar` options that can be overridden. */
3737
export interface MatProgressBarDefaultOptions {
38-
/** Default color of the progress bar. */
38+
/**
39+
* Default theme color of the progress bar. This API is supported in M2 themes only,
40+
* it has no effect in M3 themes.
41+
*
42+
* For information on applying color variants in M3, see
43+
* https://material.angular.io/guide/theming#using-component-color-variants.
44+
*/
3945
color?: ThemePalette;
4046

4147
/** Default mode of the progress bar. */
@@ -128,7 +134,13 @@ export class MatProgressBar implements AfterViewInit, OnDestroy {
128134
_isNoopAnimation = false;
129135

130136
// TODO: should be typed as `ThemePalette` but internal apps pass in arbitrary strings.
131-
/** Theme palette color of the progress bar. */
137+
/**
138+
* Theme color of the progress bar. This API is supported in M2 themes only, it
139+
* has no effect in M3 themes.
140+
*
141+
* For information on applying color variants in M3, see
142+
* https://material.angular.io/guide/theming#using-component-color-variants.
143+
*/
132144
@Input()
133145
get color() {
134146
return this._color || this._defaultColor;

0 commit comments

Comments
 (0)