blob: d1ae43dc328a7bea9094cefc542430c0b23abaf7 [file] [log] [blame]
<h2 id="introduction">Introduction</h2>
<p>The Material Design Lite (MDL) <strong>progress</strong> component is a visual indicator of background activity in a web page or application. A progress indicator consists of a (typically) horizontal bar containing some animation that conveys a sense of motion. While some progress devices indicate an approximate or specific percentage of completion, the MDL progress component simply communicates the fact that an activity is ongoing and is not yet complete.</p>
<p>Progress indicators are an established but non-standardized feature in user interfaces, and provide users with a visual clue to an application&#39;s status. Their design and use is therefore an important factor in the overall user experience. See the progress component&#39;s <a href="http://www.google.com/design/spec/components/progress-activity.html">Material Design specifications page</a> for details.</p>
<h3 id="to-include-an-mdl-progress-component-">To include an MDL <strong>progress</strong> component:</h3>
<p>&nbsp;1. Code a <code>&lt;div&gt;</code> element. Include any desired attributes and values, such as an id or width &mdash; typically done using external CSS rather than the inline <code>style</code> attribute as shown here.</p>
<pre><code class="lang-html">&lt;div id=&quot;prog1&quot; style=&quot;width:250px&quot;&gt;&lt;/div&gt;
</code></pre>
<p>&nbsp;2. Add one or more MDL classes, separated by spaces, to the div using the <code>class</code> attribute.</p>
<pre><code class="lang-html">&lt;div id=&quot;prog1&quot; style=&quot;width:250px&quot; class=&quot;mdl-js-progress&quot;&gt;&lt;/div&gt;
</code></pre>
<p>The progress component is ready for use.</p>
<h4 id="examples">Examples</h4>
<p>A static (non-animated) progress indicator.</p>
<pre><code class="lang-html">&lt;div id=&quot;progstatic&quot; style=&quot;width:250px&quot; class=&quot;mdl-js-progress&quot;&gt;&lt;/div&gt;
</code></pre>
<p>An active (animated) progress indicator.</p>
<pre><code class="lang-html">&lt;div id=&quot;progactive&quot; style=&quot;width:200px&quot; class=&quot;mdl-js-progress
mdl-progress--indeterminate&quot;&gt;&lt;/div&gt;
</code></pre>
<h2 id="configuration-options">Configuration options</h2>
<p>The MDL CSS classes apply various predefined visual and behavioral enhancements to the progress indicator. The table below lists the available classes and their effects.</p>
<table>
<thead>
<tr>
<th>MDL class</th>
<th>Effect</th>
<th>Remarks</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>mdl-js-progress</code></td>
<td>Assigns basic MDL behavior to progress indicator</td>
<td>Required</td>
</tr>
<tr>
<td><code>mdl-progress--indeterminate</code></td>
<td>Applies animation effect</td>
<td>Optional</td>
</tr>
</tbody>
</table>
<blockquote>
<p>Note: <code>mdl-progress__intermediate</code> does exist within the codebase. It is deprecated since the name is not in BEM alignment. It will be removed in 2.0.</p>
</blockquote>