Skip to content

Commit 902c9d6

Browse files
Merge pull request #4439 from material-components:linear-progress-docs
PiperOrigin-RevId: 539759187
2 parents 0607d9c + 1b26d73 commit 902c9d6

File tree

3 files changed

+116
-4
lines changed

3 files changed

+116
-4
lines changed

catalog/src/ssr.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ import '@material/web/button/filled-button.js';
2727
import '@material/web/button/tonal-button.js';
2828
import '@material/web/button/outlined-button.js';
2929
import '@material/web/button/text-button.js';
30+
import '@material/web/linearprogress/linear-progress.js';
41.2 KB
Loading

docs/components/linear-progress.md

Lines changed: 115 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<!-- catalog-only-start --><!-- ---
2+
name: Linear Progress
3+
dirname: linearprogress
4+
ssrOnly: true
5+
-----><!-- catalog-only-end -->
6+
7+
<catalog-component-header>
8+
<catalog-component-header-title slot="title">
9+
110
# Linear progress
211

312
<!--*
@@ -6,10 +15,17 @@ freshness: { owner: 'lizmitchell' reviewed: '2023-05-02' }
615
tag: 'docType:reference'
716
*-->
817

9-
<!-- go/md-linear-progress -->
18+
<!-- github-only-start -->
19+
20+
<!-- go/md-checkbox -->
1021

1122
<!-- [TOC] -->
1223

24+
**This documentation is fully rendered on the
25+
[Material Web catalog](https://material-components.github.io/material-web/components/linearprogress/)<!-- {.external} -->.**
26+
27+
<!-- github-only-end -->
28+
1329
[Progress indicators](https://m3.material.io/components/progress-indicators)<!-- {.external} -->
1430
inform users about the status of ongoing processes, such as loading an app or
1531
submitting a form.
@@ -19,21 +35,61 @@ There are two types of progress indicators: Linear and circular.
1935
Linear progress indicators display progress by animating along the length of a
2036
fixed, visible track.
2137

22-
![An animated image of an indeterminate linear progress indicator.](images/linearprogress/hero.gif "Linear progress indicators are composed of track and indicator")
38+
</catalog-component-header-title>
39+
40+
<img
41+
class="hero"
42+
src="images/linearprogress/hero.webp"
43+
alt="A mobile phone screen showing a card list of episode and a linear progress indicator nestled at the bottom of the top app bar showing a low loading progress"
44+
title="Linear progress can be used to show loading progress.">
45+
46+
</catalog-component-header>
2347

2448
* [Design article](https://m3.material.io/components/progress-indicators)
2549
<!-- {.external} -->
2650
* API Documentation (*coming soon*)
2751
* [Source code](https://github.com/material-components/material-web/tree/main/linearprogress)
2852
<!-- {.external} -->
2953

54+
<!-- catalog-only-start -->
55+
56+
<!--
57+
58+
## Interactive Demo
59+
60+
{% playgroundexample dirname=dirname, previewHeight=450 %}
61+
62+
-->
63+
64+
<!-- catalog-only-end -->
65+
3066
## Usage
3167

3268
Linear progress indicators may be determinate to show progress, or indeterminate
3369
for an unspecified amount of progress.
3470

35-
![Two linear progress indicators, one with half the track full and the other
36-
indeterminate.](images/linearprogress/usage.gif "Determinate and indeterminate linear progress indicators.")
71+
<!-- github-only-start -->
72+
73+
![Two linear progress indicators, one with half the track full and the other indeterminate.](images/linearprogress/usage.gif "Determinate and indeterminate linear progress indicators.")
74+
75+
<!-- github-only-end -->
76+
<!-- catalog-only-start -->
77+
78+
<!--
79+
80+
<div class="figure-wrapper">
81+
<figure
82+
style="min-width:300px;flex-direction:column;justify-content:center;gap:16px;"
83+
title="Determinate and indeterminate linear progress indicators."
84+
aria-label="Two linear progress indicators, one with half the track and the other indeterminate.">
85+
<md-linear-progress style="width:100%;" progress="0.5"></md-linear-progress>
86+
<md-linear-progress style="width:100%;" indeterminate></md-linear-progress>
87+
</figure>
88+
</div>
89+
90+
-->
91+
92+
<!-- catalog-only-end -->
3793

3894
```html
3995
<md-linear-progress progress="0.5"></md-linear-progress>
@@ -46,8 +102,29 @@ indeterminate.](images/linearprogress/usage.gif "Determinate and indeterminate l
46102
Indeterminate linear progress indicators may cycle between four colors (primary,
47103
primary container, tertiary, and tertiary container by default).
48104

105+
<!-- github-only-start -->
106+
49107
![An indeterminate linear progress indicator that cycles between four colors.](images/linearprogress/usage-four-color.gif "A four-color indeterminate linear progress indicator")
50108

109+
<!-- github-only-end -->
110+
<!-- catalog-only-start -->
111+
112+
<!--
113+
114+
<div class="figure-wrapper">
115+
<figure
116+
style="min-width:300px;"
117+
title="A four-color indeterminate linear progress indicator"
118+
aria-label="An indeterminate linear progress indicator that cycles between four colors.">
119+
<md-linear-progress style="flex-grow:1" four-color indeterminate>
120+
</md-linear-progress>
121+
</figure>
122+
</div>
123+
124+
-->
125+
126+
<!-- catalog-only-end -->
127+
51128
```html
52129
<md-linear-progress four-color indeterminate></md-linear-progress>
53130
```
@@ -82,8 +159,42 @@ Token | Default value
82159

83160
### Example
84161

162+
<!-- github-only-start -->
163+
85164
![Image of a linear progress indicator with a different theme applied](images/linearprogress/theming.png "Linear progress theming example.")
86165

166+
<!-- github-only-end -->
167+
<!-- catalog-only-start -->
168+
169+
<!--
170+
171+
<div class="figure-wrapper">
172+
<figure
173+
style="min-width:300px;"
174+
class="styled-example"
175+
aria-label="Image of a linear progress indicator with a different theme applied"
176+
title="Linear progress theming example.">
177+
<style>
178+
.styled-example {
179+
background-color: white;
180+
--md-linear-progress-track-height: 8px;
181+
--md-linear-progress-track-shape: 8px;
182+
--md-linear-progress-active-indicator-height: 8px;
183+
--md-sys-color-primary: #006A6A;
184+
--md-sys-color-surface-container-highest: #DDE4E3;
185+
}
186+
.styled-example md-linear-progress {
187+
flex-grow: 1;
188+
}
189+
</style>
190+
<md-linear-progress progress="0.5"></md-linear-progress>
191+
</figure>
192+
</div>
193+
194+
-->
195+
196+
<!-- catalog-only-end -->
197+
87198
```html
88199
<style>
89200
:root {

0 commit comments

Comments
 (0)