|
| 1 | +# `<mwc-circular-progress>` [](https://www.npmjs.com/package/@material/mwc-circular-progress) |
| 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 | +<img src="images/showcase.gif" height="48px"> |
| 9 | + |
| 10 | +[Material Design Guidelines: Progress Indicators](https://material.io/components/progress-indicators/#circular-progress-indicators) |
| 11 | + |
| 12 | +[Demo](https://material-components.github.io/material-components-web-components/demos/circular-progress/) |
| 13 | + |
| 14 | +## Example usage |
| 15 | + |
| 16 | +### Determinate |
| 17 | + |
| 18 | +<img src="images/determinate.png" height="48px"> |
| 19 | + |
| 20 | +```html |
| 21 | +<script type="module"> |
| 22 | + import '@material/mwc-circular-progress'; |
| 23 | +</script> |
| 24 | +<mwc-circular-progress progress="0.7"></mwc-circular-progress> |
| 25 | +``` |
| 26 | + |
| 27 | +### Indeterminate |
| 28 | + |
| 29 | +<img src="images/indeterminate.gif" height="48px"> |
| 30 | + |
| 31 | +```html |
| 32 | +<mwc-circular-progress indeterminate></mwc-circular-progress> |
| 33 | +``` |
| 34 | + |
| 35 | +### Styled |
| 36 | + |
| 37 | +<img src="images/styled.gif" height="48px"> |
| 38 | + |
| 39 | +```html |
| 40 | +<style> |
| 41 | + mwc-circular-progress { |
| 42 | + --mdc-theme-primary: red; |
| 43 | + } |
| 44 | +</style> |
| 45 | +<mwc-circular-progress indeterminate></mwc-circular-progress> |
| 46 | +``` |
| 47 | + |
| 48 | +## API |
| 49 | + |
| 50 | +### Slots |
| 51 | + |
| 52 | +None |
| 53 | + |
| 54 | +### Properties/Attributes |
| 55 | + |
| 56 | +| Name | Type | Default | Description | |
| 57 | +| --------------- | --------- | ------- | ----------------- | |
| 58 | +| `indeterminate` | `boolean` | `false` | Sets the | |
| 59 | +: : : : circular-progress : |
| 60 | +: : : : into its : |
| 61 | +: : : : indeterminate : |
| 62 | +: : : : state. : |
| 63 | +| `progress` | `number` | `0` | Sets the progress | |
| 64 | +: : : : bar's value. : |
| 65 | +: : : : Value should be : |
| 66 | +: : : : between [0, 1]. : |
| 67 | +| `density` | `number` | `0` | Sets the progress | |
| 68 | +: : : : indicator's : |
| 69 | +: : : : sizing based on : |
| 70 | +: : : : density scale. : |
| 71 | +: : : : Minimum value is : |
| 72 | +: : : : -8 . Each unit : |
| 73 | +: : : : change in density : |
| 74 | +: : : : scale corresponds : |
| 75 | +: : : : to 4px change in : |
| 76 | +: : : : side dimensions. : |
| 77 | +: : : : The stroke width : |
| 78 | +: : : : adjusts : |
| 79 | +: : : : automatically. : |
| 80 | +| `closed` | `boolean` | `false` | Sets the progress | |
| 81 | +: : : : indicator to the : |
| 82 | +: : : : closed state. : |
| 83 | +: : : : Sets content : |
| 84 | +: : : : opacity to 0. : |
| 85 | +: : : : Typically should : |
| 86 | +: : : : be set to true : |
| 87 | +: : : : when loading has : |
| 88 | +: : : : finished. : |
| 89 | + |
| 90 | +### Methods |
| 91 | + |
| 92 | +Name | Description |
| 93 | +----------------- | ------------------------------------------ |
| 94 | +`open() => void` | Sets `CircularProgress.closed` to `false`; |
| 95 | +`close() => void` | Sets `CircularProgress.closed` to `true`; |
| 96 | + |
| 97 | +### Events |
| 98 | + |
| 99 | +None |
| 100 | + |
| 101 | +### CSS Custom Properties |
| 102 | + |
| 103 | +Name | Default | Description |
| 104 | +--------------------- | -------------------------------------------------------- | ----------- |
| 105 | +`--mdc-theme-primary` |  `#6200EE` | Sets the color of primary progress bar. |
0 commit comments