Skip to content

Commit a5b97a1

Browse files
allan-chencopybara-github
authored andcommitted
docs(circular-progress): add docs for four color variant
PiperOrigin-RevId: 324677636
1 parent 21c5556 commit a5b97a1

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# `<mwc-circular-progress-four-color>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-circular-progress-four-color.svg)](https://www.npmjs.com/package/@material/mwc-circular-progress-four-color)
2+
> IMPORTANT: The Material Web Components are a work in progress and subject to
3+
> major changes until 1.0 release.
4+
5+
Progress indicators express an unspecified wait time or display the length of a
6+
process.
7+
8+
The four color circular progress indicator rotates between four colors in
9+
indeterminate mode.
10+
11+
<img src="images/showcase.gif" height="48px">
12+
13+
[Material Design Guidelines: Progress Indicators](https://material.io/components/progress-indicators/#circular-progress-indicators)
14+
15+
[Demo](https://material-components.github.io/material-components-web-components/demos/circular-progress/)
16+
17+
## Example usage
18+
19+
### Determinate
20+
21+
```html
22+
<script type="module">
23+
import '@material/mwc-circular-progress-four-color';
24+
</script>
25+
<mwc-circular-progress-four-color progress="0.7"></mwc-circular-progress-four-color>
26+
```
27+
28+
### Indeterminate
29+
30+
```html
31+
<mwc-circular-progress-four-color indeterminate></mwc-circular-progress-four-color>
32+
```
33+
34+
### Styled
35+
36+
The four-color Circular Progress Indicator does not specify the value of the
37+
four colors by default. These colors may be specified as follows:
38+
39+
<img src="images/showcase.gif" height="48px">
40+
41+
```html
42+
<style>
43+
mwc-circular-progress {
44+
--mdc-circular-progress-bar-color-1: #2196f3;
45+
--mdc-circular-progress-bar-color-2: #e91e63;
46+
--mdc-circular-progress-bar-color-3: #ffc107;
47+
--mdc-circular-progress-bar-color-4: #03dac5;
48+
}
49+
</style>
50+
<mwc-circular-progress-four-color indeterminate></mwc-circular-progress-four-color>
51+
```
52+
53+
## API
54+
55+
### Slots
56+
57+
None
58+
59+
### Properties/Attributes
60+
61+
| Name | Type | Default | Description
62+
| --------------- | --------- | ------- | -----------
63+
| `indeterminate` | `boolean` | `false` | Sets the circular-progress into its indeterminate state.
64+
| `progress` | `number` | `0` | Sets the progress bar's value. Value should be between [0, 1].
65+
| `density` | `number` | `0` | Sets the progress indicator's sizing based on density scale. Minimum value is `-8`. Each unit change in density scale corresponds to 4px change in side dimensions. The stroke width adjusts automatically.
66+
| `closed` | `boolean` | `false` | Sets the progress indicator to the closed state. Sets content opacity to 0. Typically should be set to true when loading has finished.
67+
68+
### Methods
69+
70+
Name | Description
71+
----------------- | ------------------------------------------
72+
`open() => void` | Sets `CircularProgress.closed` to `false`;
73+
`close() => void` | Sets `CircularProgress.closed` to `true`;
74+
75+
### Events
76+
77+
None
78+
79+
### CSS Custom Properties
80+
81+
Name | Default | Description
82+
------------------------------------- | ------------------------------------------------------------------- | -----------
83+
`--mdc-theme-primary` | ![](images/color_6200ee.png) `#6200EE` | Sets the color of determinate progress bar. If the indeterminate four colors are unset, sets the color for indeterminate state as well.
84+
`--mdc-circular-progress-bar-color-1` | `--mdc-theme-primary` | Sets the first of the four rotating colors.
85+
`--mdc-circular-progress-bar-color-2` | `--mdc-theme-primary` | Sets the second of the four rotating colors.
86+
`--mdc-circular-progress-bar-color-3` | `--mdc-theme-primary` | Sets the third of the four rotating colors.
87+
`--mdc-circular-progress-bar-color-4` | `--mdc-theme-primary` | Sets the last of the four rotating colors.
82 Bytes
Loading
419 KB
Loading

0 commit comments

Comments
 (0)