menumenu_openMDC

Wavy Progress Indicator

descriptionREADMEwidgetsDemo

Material Design 3 Expressive wavy progress indicator component (mdc-wavy-progress-indicator), replicating Jetpack Compose's LinearWavyProgressIndicator and CircularWavyProgressIndicator animations, transitions, and full customization options.

Usage

<mdc-wavy-progress-indicator value="0.65"></mdc-wavy-progress-indicator>
<mdc-wavy-progress-indicator variant="circular" value="0.65"></mdc-wavy-progress-indicator>
<mdc-wavy-progress-indicator indeterminate></mdc-wavy-progress-indicator>

Properties

Property Attribute Type Default Description
variant variant 'linear' | 'circular' 'linear' Layout variant
value value number 0 Determinate progress value (0 – max)
max max number 1 Maximum progress value
indeterminate indeterminate boolean false Indeterminate wavy animation mode
circularSize circular-size 'extra-small' | 'small' | 'medium' | 'large' 'medium' Circular size preset
wavelength wavelength number | null null Wavelength override in px
waveSpeed wave-speed number | null null Wave scroll speed in px/s (0 static, <0 reverse, null = wavelength)
waveAmplitude wave-amplitude number | null null Max wave peak amplitude override in px
amplitude — number | ((progress: number) => number) | null null Normalized amplitude [0, 1] or Compose-style (progress) => number callback
strokeWidth stroke-width number | null null Active indicator stroke thickness in px
trackStrokeWidth track-stroke-width number | null null Track stroke thickness in px
strokeCap stroke-cap 'round' | 'butt' | 'square' 'round' Active indicator stroke cap
trackStrokeCap track-stroke-cap 'round' | 'butt' | 'square' 'round' Track stroke cap
gapSize gap-size number | null null Visual gap between active indicator and track in px (0 disables gap)
stopSize stop-size number | null null Stop indicator diameter in px (0 hides stop indicator)
animated animated boolean true Enables built-in spring & amplitude transitions

Circular Size

Code
<mdc-wavy-progress-indicator variant="circular" circular-size="extra-small" value="0.6"></mdc-wavy-progress-indicator>
<mdc-wavy-progress-indicator variant="circular" circular-size="small" value="0.6"></mdc-wavy-progress-indicator>
<mdc-wavy-progress-indicator variant="circular" circular-size="medium" value="0.6"></mdc-wavy-progress-indicator>
<mdc-wavy-progress-indicator variant="circular" circular-size="large" value="0.6"></mdc-wavy-progress-indicator>

Customization

Code
<div style="display: flex; flex-direction: column; gap: 16px; max-width: 480px;">
    <mdc-wavy-progress-indicator variant="linear" value="0.6" stroke-width="6" track-stroke-width="2" wave-amplitude="4"></mdc-wavy-progress-indicator>
    <mdc-wavy-progress-indicator variant="linear" value="0.6" stroke-cap="butt" track-stroke-cap="butt" gap-size="0" stop-size="0"></mdc-wavy-progress-indicator>
    <mdc-wavy-progress-indicator variant="linear" value="0.6" wavelength="24" wave-speed="-48"></mdc-wavy-progress-indicator>
    <mdc-wavy-progress-indicator variant="linear" value="0.6" wave-speed="0"></mdc-wavy-progress-indicator>
</div>

Indeterminate

Code
<mdc-wavy-progress-indicator variant="linear" indeterminate></mdc-wavy-progress-indicator>
<mdc-wavy-progress-indicator variant="circular" indeterminate></mdc-wavy-progress-indicator>

Interactive

Code
<div style="display: flex; flex-direction: column; gap: 16px; max-width: 480px;">
    <mdc-wavy-progress-indicator id="wavy-interactive-linear" variant="linear" value="0.5"></mdc-wavy-progress-indicator>
    <div style="display: flex; align-items: center; gap: 16px;">
        <mdc-wavy-progress-indicator id="wavy-interactive-circular" variant="circular" value="0.5"></mdc-wavy-progress-indicator>
        <label style="display: flex; align-items: center; gap: 8px; flex: 1;">
            <span>Progress:</span>
            <input type="range" min="0" max="1" step="0.01" value="0.5" style="flex: 1;"
                oninput="
                    const root = this.getRootNode();
                    const linear = root.getElementById('wavy-interactive-linear');
                    const circular = root.getElementById('wavy-interactive-circular');
                    const val = Number(this.value);
                    if (linear) linear.value = val;
                    if (circular) circular.value = val;
                "
            />
        </label>
        <label style="display: flex; align-items: center; gap: 4px;">
            <input type="checkbox"
                onchange="
                    const root = this.getRootNode();
                    const linear = root.getElementById('wavy-interactive-linear');
                    const circular = root.getElementById('wavy-interactive-circular');
                    if (linear) linear.indeterminate = this.checked;
                    if (circular) circular.indeterminate = this.checked;
                "
            />
            <span>Indeterminate</span>
        </label>
    </div>
</div>

Value

Code
<mdc-wavy-progress-indicator variant="linear" value="0"></mdc-wavy-progress-indicator>
<mdc-wavy-progress-indicator variant="linear" value="0.05"></mdc-wavy-progress-indicator>
<mdc-wavy-progress-indicator variant="linear" value="0.5"></mdc-wavy-progress-indicator>
<mdc-wavy-progress-indicator variant="linear" value="0.96"></mdc-wavy-progress-indicator>
<mdc-wavy-progress-indicator variant="linear" value="1"></mdc-wavy-progress-indicator>

<mdc-wavy-progress-indicator variant="circular" value="0"></mdc-wavy-progress-indicator>
<mdc-wavy-progress-indicator variant="circular" value="0.5"></mdc-wavy-progress-indicator>
<mdc-wavy-progress-indicator variant="circular" value="1"></mdc-wavy-progress-indicator>

Variant

Code
<mdc-wavy-progress-indicator variant="linear" value="0.5"></mdc-wavy-progress-indicator>
<mdc-wavy-progress-indicator variant="circular" value="0.5"></mdc-wavy-progress-indicator>